As a recent experiment, I tried converting a blog from Mephisto to WordPress. After some quick Googling, I found out that Jason Gill had already largely solved the problem.
Unfortunately, his solution didn’t completely work for me because I didn’t want to launch Mephisto to do it and I have an aversion with that much code in a controller. Even if it’s just going to be run once. Even if it’s just locally. I know, I have a problem. Anyway, I wanted to launch it from the command line also.
I had been planning to move the Rails Envy blog to a different server and saw this as a good opportunity. The plan was to migrate the blog offline and put it on a separate subdomain (something like omgbeta.railsenvy.com). Once everything is totally working, I’d just point the main dns over. This is a fairly good strategy regardless of the application (blog, app, etc). First, though, I had to get that script working. Here’s what I came up with: