Migrating from Blogger to WordPress

Ok, here’s my third exciting post on my Blogger to WordPress migration. After failing miserably with my attempt to migrate from Blogger to Drupal, I wasn’t sure what to expect from the WordPress Blogger import tool.

Drupal’s importer is a third-party module that hasn’t been updated recently. (There might be another one out there that I don’t know about, but I never found one.) It imports from an XML file that you export from Blogger. WordPress, on the other hand, uses Google’s API to connect to Blogger directly, and read all your posts. It pulls in posts, comments, and images. My old blog had about 1600 posts, and it pulled them all in, pretty quickly.

After importing, I used this guide to help me figure out how to set up my permalinks to (pretty much) match Bloggers, then run a PHP script to fix up the permalinks to exactly match Blogger’s. I also had Blogger putting a “.html” at the end of the post URLs. (I’m not sure if that was standard, or if that was an artifact from when I switched from Blogger’s FTP publishing, where I was actually creating HTML pages for each post.) So I had to create a rewrite rule in my .htaccess file to deal with that. Now that I’ve done that, I’m pretty sure most individual post URLs from the old blog will redirect correctly to the corresponding pages on the new blog.

In terms of the DNS stuff, I had to change Blogger to point to a new subdomain (“oldblog” in case you’re curious), so I could free up “blog.andrewhuey.com” for the new WordPress install. I hit a slight snag there, as I deleted the “blog” subdomain in 1&1, with the intention of letting the “click & build” install recreate it. But it turns out that deleting a subdomain in 1&1 can take a while, and the subdomain is basically locked while you’re waiting for it to happen. So I got an opportunity to run out for an iced coffee.

One other minor snag I hit involved DNS. I’ve had my router configured to use Google’s DNS servers for a while now. Well, Google didn’t quite want to let go of “blog.andrewhuey.com”, and got a bit confused about it, so I had to switch to using my ISP’s DNS servers, so I could actually reach the new blog. (Weirdly, it had worked fine for a while, then just stopped, and started returning errors. At first, I thought there was something wrong with the WordPress install, but then I found I could get to the blog on my phone.) At some point, I’ll switch back to Google DNS, or maybe OpenDNS.

I plan to write up at least one more post on my WordPress migration, covering themes and plugins. Maybe tomorrow.

Update: I spoke too soon!

I just figured out that the Blogger importer stripped out all JavaScript embeds in my posts, or at least certain ones. The end result of this is that all my GitHub Gists are missing. So any posts with source code now have no source code. So the most useful posts on my site are now kind of useless. Great!

Finding all the posts with Gists is proving to be a bit of a challenge too, since I can’t search for text within script tags via the Blogger interface, so I can’t just search for “gist.github.com” or anything obvious like that. But I think I’ve found most of them now.

Oh, and in WordPress, you can apparently reference a Gist simply by pasting the URL to the Gist in, and it gets magically expanded. Which is nice. (It looks like this is part of Jetpack, rather than core WP. And there are a bunch of other cool shortcodes you can use.)

But I’m also seeing now that my current WordPress theme isn’t the best for rendering Gists. But one thing at a time. Let’s try to get them all back in there first, shall we?

One thought on “Migrating from Blogger to WordPress”

  1. Google has been a bit disappointing recently what with their unwillingness to properly support certificates, especially their revocation so it is less surprising to me than it would have been a week ago to hear that google is not handling DNS well.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.