A couple of friends have just started blogging (Keith & Jonny), I was stunned how clean and simple their blogs look. At the same time I’ve been getting frustrated at several things in MovableType (like the lack of any decent online editing tools for creating posts, and the fact that it is painfully slow on my VPS), so I had a quick look at the blogging software they are using, WordPress. I was mightly impressed, it seems to be much slicker & easier to use than MT, I was even more impressed that I could import all my current entries & comments, and that there’s plenty of help in making old links work. So I exported my stuff from MT & imported into WordPress, with the help of notes from here. I’ve also got over my need for everything to be in perl.

The next challenge was to ensure that old links get redirected to the content properly, this was mostly just a technical challenge as this blog is mostly private, I doubt anybody I don’t know reads it, so ensuring that links in search engine indexes is largely moot. (I had to struggle to find a reference to my blog in Google, resorting to restricting it to my site, like this). Anyway, I found a couple of pointers that sent me in the right direction, like one from the WordPress wiki and one from the newer Codex resource.

I ran into some snags in the method used here, mostly because the permalink/archive method I had used in MT was YYYY/MM/entry, so here’s the template I needed:

<?php<br /> require('wp-config.php');<br /> header('Content-type: text/plain');<br /> ?><br /> <MTEntries lastn="999999"><br /> Redirect Permanent /archives/<$MTArchiveDate format="%Y/%m"$>/<MTArchiveFile><br /> http://www.mccartney.ie/wordpress/<$MTArchiveDate format="%Y/%m/%d"$>/<?php echo sanitize_title("<$MTEntryTitle$>"); ?></MTEntries>

This generates a file that us suitable for using as a .htaccess file, making Apache redirect requests for the old MT URIs to the new WordPress URIs. For the category links, I’ve just hand crafted the lines, I only had a couple of categories.

(In writing this post, I’ve discovered some of the problems with quoting PHP in a PHP based system, so I’ve started to read this and promise to make the template above make sense soon, I also found this) Done.