That didn’t suck much

I’ve migrated my blog from to here.

It wasn’t easy.  Maybe I didn’t do it right, but for future reference:

I used WordPress’s import/export plugin to export all the posts from the old site to XML and then imported that here, including attachments.  Done and done, right?  Not so much.

It didn’t actually copy over the uploaded content like pictures and map data; the posts still contained links to the files in situ at the old site.  So I manually SCPed them all over and then had to go through all the posts updating the base URLs of all the media references.

Then I noticed that not all posts had been imported.  So I did the export again, and this time manually edited the XML file to fix up the URLs (gotta love Emacs search and replace) and remove what would be duplicate posts, and imported the result.  That worked, and I think everything is hunky dory now.

If I had to do this again:

I used the import/export plugin because I expected it to bring ALL the content over for me.  If I had known it wouldn’t, I probably would have initially just exported the MySQL database contents and imported that via the MySQL admin panel, but I still would have had to manually fix up all the URLs (or learn how to do a GSR in SQL).

A better solution would probably have been to still use the import/export thing, and knowing how it would screw up, manually copy over the external content and use Emacs to fix up the URLs in one swell foop before importing the posts.

Not terribly pleased with how easy this was.

Oh, and another way it screwed up: I had set up my plugins at the new site before doing the import, and the WP-to-Twitter plugin went and tweeted about every single one of the imported posts!  Who thought that would be a good idea?  Plugins that run on publish should not (or should optionally not) run again on imported posts.  I had to go manually delete all that crap from Twitter.  So disable your autopost plugins before doing an import.

Comments are closed.