Migrating this blog from Typo to WordPress

After recently installing Phusion Passenger under Apache 2 to host my Rails apps I wanted to give Ruby Enterprise Edition a go. However as I was running an old version of Typo (version 4.x) which didn’t seem to like running under REE I decided to migrate to WordPress; upgrading Typo would be just as much work. 

There’s already a Ruby upgrade script to create a WordPress compatible WXR file for importing which includes all posts, comments and categories from Typo. I needed to modify the Ruby script slightly to get working with the version of Typo I had installed.

Exporting Typo blog content to WordPress WXR

The Ruby script needs to be placed into the script directory of the Typo application root and then run under the production Rails environment:

RAILS_ENV=production ruby script/wp_export.rb > blog.wxr

Installing WordPress

Simply follow the basic WordPress install guide after downloading the latest software (version 2.7 at the time of writing). The pre-requisites for WordPress are PHP 4.3 or newer and MySQL 4.0 or greater.

Import existing content

Once WordPress is installed, log in to the admin section and select Import from the Tools menu. Choose the WordPress option from the list (Import posts, pages, comments, custom fields, categories, and tags from a WordPress export file). You’ll need to select the blog.wxr file created by the Ruby script and then click Upload file and import. That should recreate your existing Typo blog content (and comments), you may be asked to map the Typo user(s) to WordPress accounts.

With the content installed, the final change required is to setup the Permalink Settings from Settings > Permalinks. Select the Day and name option (giving URLs such as http://www.slashdotdash.net/2009/01/02/sample-post/). You may need to manually edit or create the .htaccess file to get the rewrite rules working.

# .htaccess

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

With this working you should find that the standard Typo permalinks (such as http://www.slashdotdash.net/articles/2009/01/02/sample-post/) will now redirect to the corresponding WordPress blog entry, ensuring no broken links when switching from Typo to WordPress.

Known Issues

You’ll probably have a problem with RSS feed readers creating duplicates of the last 10 posts (depending upon your “Syndication feeds show the most recent” settings) since the post URLs and GUIDs will have changed.


About this entry