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

  • What WP version are you running? And the Importer plugin version? I suppose it'll be the latest, but just in case... Are you trying the import just after having installed the new site or do you already have plugins and new theme activated? Also, what does the new server error_log shows?
    – brasofilo
    Commented Nov 14, 2012 at 11:30

4 Answers 4


Although Chip's method may work for some it did not for me. I did get it working however this way:

  1. Do the normal export of pages and posts and import them to your new blog (having deleted the original pages and posts)
  2. Download the wp-content/uploads folder via ftp from your old site and upload it to your new site, replacing what's there.
  3. Go into phpmyadmin on the old site and use an SQL query to select all posts that have post type = "attachment" in the wp_posts table. Export the results of this query and save on your PC.
  4. Export the wp_terms table from your old site.
  5. Import both the mySQL exports from your old site into your new site via phpmyadmin.
  6. Use the "search and replace" plugin to replace all occurrences of your old domain in your database with your new domain.

If all goes well you should have all your attachments in your new site along with all thumbnails stored and referenced correctly.

  • 4 and 5. I also exported/imported wp_options and wp_postmeta 6. Instead of plugin I used phpMyAdmin to search and replace old domain with new one in the mentioned tables
    – p.boiko
    Commented Jul 15, 2019 at 5:34

Did you tried to use plugin that updates urls after changing url of medialibrary?

Velvet Blues Update URLs

  • 1
    that plugin only appear to change the URLs of the image links in the posts/pages. It doesn't say anything about actually downloading the images from the old server to the new.
    – harryg
    Commented Nov 14, 2012 at 9:41
  • 1
    Just repalce you wp-content/uploads directory by new site wp-conten/uploads. Commented Nov 14, 2012 at 9:44
  • OK, but this still won't solve the problem that none of the images are "attached" to their respective pages. I.E there is nothing in the "media" section of WordPress backend
    – harryg
    Commented Nov 14, 2012 at 10:35
  1. Ensure both domains are active
  2. Ensure the same version of WordPress is installed on both domains
  3. Ensure the Same Theme is active on both domains
  4. Ensure the Same Plugins are active on both domains
  5. Ensure that the images are hosted and attached in the old domain.
  6. Delete all default/dummy post data from the new domain (Test Post, About page, etc.)
  7. Export all content from the old domain
  8. Import the resulting XML file to the new domain
  9. Ensure download and attach media is enabled/checked
  10. Note any errors printed during the import process
  • Thanks Chip. Ha I didn't realize you were active here. You have helped me in the past on the WP forums. I will try your method when I get a chance this evening.
    – harryg
    Commented Nov 14, 2012 at 14:25

A client wanted to start a new wp with all their old wp´s images, here is how I did it:

  1. copy the uploads folder to the new directory
  2. On the old site make an sql dump only containing the attachments, eg:

mysqldump --opt --user="user" -p database_name wp_posts --where="post_type='attachment'" > exported_attachments.sql

  1. 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

  2. Import the sql into the the new database

  3. done :)

Your Answer

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

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