1

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=./

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? Jan 17, 2017 at 9:49
  • What is the exact line you run?
    – prosti
    Jan 17, 2017 at 10:05
  • @prosti updated post
    – Jiew Meng
    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
    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). Jan 17, 2017 at 12:40

1 Answer 1

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.com/demo/theme-unit-test-data.xm‌l, there you have images like wpthemetestdata.files.wordpress.com/2010/08/manhattansummer.‌​jpg, but when the domain wpthemetestdata.files.wordpress.com 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.com/2010/08/manhattansummer.‌​jpg
1
  • i didn't understand any of this: how's it related to domains? does "wp import" not taking local (i.e. on the server) files? which domain do you need to provide, AND WHY? Dec 19, 2019 at 12:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.