So the built-in wordpress import/export feature is fantastic, albeit a little quirky. If you want to move all your content, it’s pretty painless. If you only want to move your posts, to merge with another blog for example, it’s a little trickier to get it to move your media. The “Downloand and import media” checkbox on the import side doesn’t appear to do anything. The media is stored in the database the same way as posts.

The trick is to import the media FIRST. This method will also preserve your featured images.

  1. Go to Tools -> Export from your dashboard and select “Media”, and save the XML file somewhere handy
  2. Once that’s done, go back and export the posts (or whatever type you want to export)
  3. Then on the new site, go to Tools->Import, select wordpress and then import your MEDIA file first. You can assign to an existing user or import the users if they don’t already exist. Check the box to Download and import file attachments.
  4. Step 3 will take a while but when it’s done (assuming your webhost will let you run long enough PHP scripts) all your old files will be downloaded and in the media library. Now you can import your posts, and they’ll find the featured images.

    The final step is to do a find-and-replace of all the old URLs in your database with the new ones. I really like this plugin for that.