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:

Read More

new site: http://sergedenim.es

old site: http://sergedenimes.com

Related posts

Leave a Reply

4 comments

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

    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
  2. 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 🙂