Movable Type 3.34 to WordPress 2.8.4

As you can see, I have moved my blog over to WordPress. Actually, the whole domain,, is powered by WordPress.

If you see any problems, please comment on this post or contact me.

I was using Movable Type 3.34 which came out in January 2007 and was now badly outdated. The reason why I hadn’t upgraded is because I was using a lot of hacks and had made my own modifications to the core code.

A few months ago, I ran into major problems with spam comments. That got me thinking about an upgrade. I was, however, able to solve the spam issue with MT-Akismet.

I downloaded Movable Type 4.2, the latest version, and played around with it. I liked it, but I realized that none of the plugins I was using had an upgrade for MT4. Also, I could find very few amateur bloggers on Movable Type. Professional websites and blogs were mostly using Movable Type, but the rest of the bloggers had switched to WordPress long ago.

I had already been using WordPress for a private blog and so I decided to take a look at the latest version of WordPress and how I could migrate my blog to it.

There were a few things I had to give up: No more MathML or serving all pages as application/xhtml+xml; no OpenPGP signed comments.

I also had to modify the Movable Type export script and WordPress’s import script so I could keep the same post IDs and slugs (basenames) as well as import tags and convert the content based on the text filter used in Movable Type.

Here are changes required in Movable Type 3.34’s lib/MT/ file:

---        2009-09-23 11:25:12.975789000 -0700
+++     2009-09-23 11:25:12.764003000 -0700
@@ -529,27 +529,27 @@
 AUTHOR: <$MTEntryAuthor strip_linefeeds="1"$>
 TITLE: <$MTEntryTitle strip_linefeeds="1"$>
+BASENAME: <$MTEntryBasename$>
 STATUS: <$MTEntryStatus strip_linefeeds="1"$>
 ALLOW COMMENTS: <$MTEntryFlag flag="allow_comments"$>
 CONVERT BREAKS: <$MTEntryFlag flag="convert_breaks"$>
 ALLOW PINGS: <$MTEntryFlag flag="allow_pings"$>
+POSTID: <$MTEntryID$>
-<$MTEntryBody convert_breaks="0"$>
-<$MTEntryMore convert_breaks="0"$>
 <$MTEntryExcerpt no_generate="1" convert_breaks="0"$>
+<MTEntryTags include_private="1" glue=","><$MTTagName$></MTEntryTags>
@@ -558,7 +558,7 @@
 IP: <$MTCommentIP strip_linefeeds="1"$>
 URL: <$MTCommentURL strip_linefeeds="1"$>
 DATE: <$MTCommentDate format="%m/%d/%Y %I:%M:%S %p"$>
-<$MTCommentBody convert_breaks="0"$>

And here are the changes required in WordPress 2.8.4’s wp-admin/import/mt.php:

--- mt.php.orig 2009-05-05 12:43:53.000000000 -0700
+++ mt.php      2009-09-23 11:49:00.182602000 -0700
@@ -375,6 +375,15 @@
                                        $post->post_title = $title;
                                else if ( 'ping' == $context )
                                        $ping->title = $title;
+                       } else if ( 0 === strpos($line, "BASENAME:") ) {
+                               $postname = trim( substr($line, strlen("BASENAME:")) );
+                               if ( '' == $context )
+                                       $post->post_name = $postname;
+                               else if ( 'ping' == $context )
+                                       $ping->post_name = $postname;
+                       } else if ( 0 === strpos($line, "POSTID:") ) {
+                               $postid = trim( substr($line, strlen("POSTID:")) );
+                               $post->import_id = $postid;
                        } else if ( 0 === strpos($line, "STATUS:") ) {
                                $status = trim( strtolower( substr($line, strlen("STATUS:")) ) );
                                if ( empty($status) )

I also added the following to the .htaccess file to handle the redirects needed from my old URLs to the new ones:

RewriteEngine On
RewriteBase /
# Old Monthly archives
RewriteRule ^weblog/archives/([0-9]{4})/([0-9]{2}) weblog/$1/$2/ [R,L]
# Old single entry links
RewriteRule ^weblog/archives/000([0-9]{3}).html$ ?p=$1 [R,L]
# Another old single entry links
RewriteRule ^weblog/archives/entry/000([0-9]{3}).html$ ?p=$1 [R,L]
# Old category archives
# Change underscores to hyphens
RewriteRule ^weblog/archives/([^_]*)_([^_]*)_([^_]*)_(.*)$ weblog/category/$1-$2-$3-$4/ [R=301,L]
RewriteRule ^weblog/archives/([^_]*)_([^_]*)_(.*)$ weblog/category/$1-$2-$3/ [R=301,L]
RewriteRule ^weblog/archives/([^_]*)_(.*)$ weblog/category/$1-$2/ [R=301,L]
RewriteRule ^weblog/archives/([^0-9]*)$ weblog/category/$1/ [R,L]
# To handle the old MovableType feeds.
RewriteRule ^weblog/atom\.xml$ feed/atom/ [R,L]
RewriteRule ^weblog/index\.xml$ feed/ [R,L]
RewriteRule ^weblog/index\.rdf$ feed/ [R,L]
# To handle old Movable Type permalinks.
RewriteRule ^weblog/([0-9]{4}/[0-9]{2}/.*)\.html$ $1/ [R,L]

I liked the iNove theme and installed it with some modifications done via child theme.

I have also installed the following plugins:

  1. About Me widget
  2. Akismet
  3. AmazonFeed
  4. AVH Amazon
  5. Collapsing Archives
  6. Contact Form 7
  7. Easy AdSense
  8. Efficient Related Posts
  9. Google Analyticator
  10. Google XML Sitemaps
  11. Lifestream
  12. NextGEN Gallery
  13. Now Reading Reloaded
  14. Page Links To
  15. Recommended Reading: Google Reader Shared
  16. Rich Text Biography
  17. JanRain RPX – Authentication from Facebook, Twitter, Google, Yahoo, Windows Live ID and OpenID
  18. Search & Replace
  19. Search Meter
  20. Sociable
  21. Thread Twitter
  22. WP-Syntax
  23. XML Google Maps

I am also working on a fork of Now Reading Reloaded. It will be for movies and will be called Now Watching. Once I have tested it, I’ll release it here and on the WordPress site.

While the blog itself has been completely moved over to WordPress, I am still working on migrating the other static pages. Also, my list of books read and movies watched is still not back yet.