I am redeveloping a client’s site and, for a number of reasons, in the process changing hosts.
I’m developing it on the new host and to get the site orgainised I have attempted to import all the pages from the old site using the WordPress export/import plugins.
During the import I checked the “import images” checkbox but it doesn’t seem to have worked. All the images in the pages are being loaded from the old site and the media library in the new site is empty. Here are the URLs for reference:
new site: http://sergedenim.es
old site: http://sergedenimes.com
Although Chip’s method may work for some it did not for me.
I did get it working however this way:
If all goes well you should have all your attachments in your new site along with all thumbnails stored and referenced correctly.
Did you tried to use plugin that updates urls after changing url of medialibrary?
Velvet Blues Update URLs
A client wanted to start a new wp with all their old wp´s images, here is how I did it:
mysqldump --opt --user="user" -p database_name wp_posts --where="post_type='attachment'" > exported_attachments.sql
Open the exported_attachments.sql in text-editor and replace all occurences of the old protocoll+domain to the new, eg. http://site-old.com -> https://site-new.com
Import the sql into the the new database
done 🙂