Import Images from one self-hosted WordPress install to another

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

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.

Leave a Comment