Migrated from Mephisto to WordPress

I've finally migrated this blog from Mephisto to WordPress. I've set up redirects, so ideally all the old URLs should still work fine. Apologies for the RSS feed spam, if you got hit with any. Once the dust has settled here, I'll be migrating the Rubygame blog too.

Why the switch? Simply put, Mephisto wasn't cutting it anymore. It's not as usable or polished as WordPress, and it doesn't feel like it's going anywhere. Worse, the Rails-based setup was making it difficult to keep up and running, and it was prone to mysterious breakages that would come and go with no apparent cause. In the end, it just wasn't worth it to me.

For the migration-curious, here's how I did it.

First I exported the Mephisto database from the web server and imported it to my local MySQL database. Because I was hosting two sites (this blog and the Rubygame blog) using the same Mephisto database (with Mephisto's multi-site feature), I deleted all the posts and comments associated with the Rubygame site (in other words, all the entries in the "contents" table whose site_id was 1). That way, I was left with just the posts and comments for this blog. (When I migrate the Rubygame blog, I'll reimport the database dump and do the same, but deleting contents associated with this blog, leaving only the Rubygame contents.)

Then I used m2wp.py with Jason Morrison's patch and instructions to generate a WXR (WordPress Extended RSS). I imported that to a new local WordPress install (in Tools, Import, WordPress), and cleaned everything up, fixing formatting issues, etc. I used the p2pConverter plugin to convert my two cheatsheets from "Posts" to "Pages".

Once I was happy with the local setup, I made a new WordPress install on the server hosted in a different directory than my main blog, dumped the database from my local MySQL and uploaded it to the server. Once that was set up, I created some Apache RewriteRules in the .htaccess file to catch URLs from the old scheme and redirect them to the new, correct URLs. Here's the top part of my Apache config, modified somewhat to fit the format of this blog:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

# Pages
RewriteRule ^articles/2009/8/8/git-submodule-cheat-sheet/?$ \
git-submodule-cheat-sheet [R=301,L]
RewriteRule ^articles/2007/11/17/ruby-c-extension-cheat-sheet/?$ \
ruby-c-extension-cheat-sheet [R=301,L]

# Posts
RewriteRule ^articles/(.+)$ $1 [R=301,L]

# Categories
RewriteRule ^(personal|projects|rubyweekend|ruby|\
rails|snippets|tips|misc)/?$ category/$1/ [R=301,L]

# Archives
RewriteRule ^archives/([0-9]{4})/([1-9])/?$ $1/0$2 [R=301,L]
RewriteRule ^archives/([0-9]{4})/(1[0-2])/?$ $1/$2 [R=301,L]

RewriteRule ^feed/atom.xml$ feed/ [R=301,L]
RewriteRule ^feed/comments.xml$ comments/feed/ [R=301,L]
RewriteRule ^feed/([-+_A-Za-z0-9]+)/atom.xml$ category/$1/feed/ [R=301,L]

I also set up a symlink to the old "assets" folder from Mephisto, where uploaded images and files were stored, since I didn't think it wasn't worth the effort to convert them to a new directory structure and set up redirects.

Once that was in place and set up, I changed the server configuration to point this domain to the directory containing the new blog, and voila!

So far, I've noticed only a few issues:

Other than that, everything seems to be working well. It was a fairly smooth transition, thanks to schwuk's m2wp.py script and Jason Morrison's patch!

Of course, I still need to find or create a nice blog theme, but no rush there.

Previous post: Your Git Submodule and You Next post: Dreaming of Ambienome