最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

import - WP CLI not importing media files

programmeradmin2浏览0评论

When I tried on localhost, it appears media files are imported. When I tried on real server (AWS LightSail) seems like images are not imported why might it be? I did not ask it to --skip

The main difference I see is for local one, I used wp core install etc to install the WP. For the server one the install is already done by LightSail/Bitnami. Does this make a difference? I do not expect it to?

wp import something.xml --authors=mapping.csv --path=./

When I tried on localhost, it appears media files are imported. When I tried on real server (AWS LightSail) seems like images are not imported why might it be? I did not ask it to --skip

The main difference I see is for local one, I used wp core install etc to install the WP. For the server one the install is already done by LightSail/Bitnami. Does this make a difference? I do not expect it to?

wp import something.xml --authors=mapping.csv --path=./

Share Improve this question edited Jan 17, 2017 at 11:12 Jiew Meng asked Jan 17, 2017 at 6:45 Jiew MengJiew Meng 1,9115 gold badges24 silver badges40 bronze badges 10
  • Is it possible to upload media through wordpress dashboard on this remote server? What is the message from wp cli when you try to import? – Mateusz Marchel Commented Jan 17, 2017 at 9:49
  • What is the exact line you run? – prosti Commented Jan 17, 2017 at 10:05
  • @prosti updated post – Jiew Meng Commented Jan 17, 2017 at 11:12
  • @MateuszMarchel, at the end a success message Success: Finished importing from 'something.xml' file. so its OK? Posts are imported just that images are still linked to old site – Jiew Meng Commented Jan 17, 2017 at 11:14
  • Ok, so if I understand correctly: You have exported wordpress posts and now you want to import this via wp-cli but links to images have wrong urls? Is it correct? At first I understand that you have problem with media importing (wp media import). – Mateusz Marchel Commented Jan 17, 2017 at 12:40
 |  Show 5 more comments

1 Answer 1

Reset to default 1

wp import something.xml

The possible problem with this solution is when the original domain is not available from the web server you are on. Try to ping the domain name from the AWS LightSail.

You know for the wpcom-themes.svn.automattic/demo/theme-unit-test-data.xm‌l, there you have images like wpthemetestdata.files.wordpress/2010/08/manhattansummer.‌​jpg, but when the domain wpthemetestdata.files.wordpress is not available anymore the whole thing with resources will not work.


Also do you get some feedback of success / failure like this

# Import content from a WXR file
$ wp import example.wordpress.2016-06-21.xml --authors=create
Starting the import process...
Processing post #1 ("Hello world!") (post_type: post)
-- 1 of 1
-- Tue, 21 Jun 2016 05:31:12 +0000
-- Imported post as post_id #1
Success: Finished importing from 'example.wordpress.2016-06-21.xml' file.

Finally if you try to wget some image from your origianal website what you will get?

Something like this but on your domain.

 wget wpthemetestdata.files.wordpress/2010/08/manhattansummer.‌​jpg
发布评论

评论列表(0)

  1. 暂无评论