Migrating From Octopress to WordPress

After several months of running this blog using the static blogging system Octopress, I‘ve moved back to self hosted WordPress. There’s a lot of things I liked about Octopress, and there’s a lot of things to not like about WordPress, so like everything, it really it just came down to which tradeoffs I could live with.

The main benefits you hear about when moving to a static system like Octopress are:

  1. Your site won’t go down when you get Fireballed.
  2. Your published site is all static files, so it loads really fast.
  3. You get to write in Markdown, and your files get stored that way.
  4. Easy to keep posts under source control.
  5. The default theme is pretty nice (on Octopress specifically).

Some of this, I think, gets oversold, and no one ever seems to focus much on the disadvantages (some of these apply more to Octopress than other systems):

  1. Your posts all get saved and stored as plain text — which is great — but because of that if you ever want to move to another system that doesn’t happen to use static files formatted exactly the same way, it’s non-trivial to get them into that system.
  2. If you’re not a Ruby developer, setting everything set up and working correctly is probably going to be a pain in the ass.
  3. Using an app like MarsEdit probably isn’t going to be an option. I tried a couple times and could never get OctoMars working correctly.
  4. It’s going to be pretty hard to blog from your iPhone/iPad unless you set up some kind of Rube Goldberg machine involving Dropbox or SSH-ing into a server. That’s adding a lot of friction.
  5. If you don’t like the default theme, there’s a lot less out there to use, and I found writing one from scratch to be pretty inscrutable.

Of course, a lot of this applies to just me. If you’re not worried about migrating out of a static system later, don’t have a favorite blogging app or don’t care about being able to publish from your phone, most of this isn’t really going to apply. And, for what it’s worth, a few of my other issues — including the fact that Octopress hasn’t had a major update in two years — probably would have not have been an issue had I chose Pelican instead of Octopress.

Octopress to WordPress Migration Script

If you search for guides on how to migrate from WordPress to Octopress, you’ll get a lot of results, but not so many the other way that describe how to actually migrate a large number of posts the other way. I also had to think of someway to maintain a bit of my nerd cred, and so I wrote a script to do the migration.

What it does is parse an Octopress _posts directory, reads the YAML front matter and content, and then sends it to a WordPress blog using the WordPress XML-RPC API (there was a good Python module for this part). I can’t guarantee that it‘ll work in your specific case, and it won’t retain categories from Octopress, but it did work for me. I’ve put the script on GitHub for others to use and improve.