Moving from MovableType 2.x to WordPress 1.2

First some background: I was running MovableType 2.661 on FreeBSD 4.10, with MySQL as the datastore, Apache 1.3.31 as the http server, with mod_perl and mod_gzip to make things easier/faster. The first step is to extract all your content from your existing MT instance. Navigate through your www.sitename.com/and/path/mt.cgi to the menu and find the export option (the menu looks like what you see below).

If you haven’t already done so go read this tutorial by someone on the WordPress team. If his best case scenario doesn’t quite work for you, read on.

First some background: I was running MovableType 2.661 on FreeBSD 4.10, with MySQL as the datastore, Apache 1.3.31 as the http server, with mod_perl and mod_gzip to make things easier/faster. The requirements for WordPress are here.

Go ahead and install it: it’s literally a 5 minute procedure, so if you set it up, tinker with it and tear it down again, you’re not out much.

The first step is to extract all your content from your existing MT instance.

Navigate through your www.sitename.com/and/path/mt.cgi to the menu and find the export option.

Click on import/export . . . . You should see something that looks like what see below.

The stuff there is self-explanatory: I didn’t find that saving to a file worked. I had to load the export and then save that. Not a big deal. If you’re using Safari, you may have issues with it timing out on l-o-o-n-g downloads. The solution to that is here.

So you have your exported weblog content saved to a file. If you have WordPress already running (your webserver is running with a suitable version of PHP), you’ll find that the nice folks at WordPress have an importer for MT content that works like a champ.

Go to http://your.webserver/wherever-you-put-WordPress/wp-admin/import-mt.php

Follow the instructions there (this assumes you’ve done the MySQL setup: create a database and user with the user having the correct privileges. You have installed WordPress and looked it over before coming this far, right?)

So you’ve let the importer rip and you have some number of entries that matches what your MT install claims (or more correctly, your database: MT doesn’t renumber if you delete entries).

The major gotcha I found was that I couldn’t login as me: I could as the site admin user, but that meant that new posts were “owned” by the admin and not by me. And I had a lot of trouble making the password work: for some reason, even when I had WP reset my password and mail it to me, it never worked. I never figured out why that didn’t work.

After some investigation, I found that WP expects an MD5 hash password, not whatever MySQL does when you do a “UPDATE crank_users SET user_pass=PASSWORD(‘password’) WHERE user_login=’me’;” To get around that, I used CocoaMySQL to access the data and used a hash generated by http://bfl.rctek.com/tools/?tool=hasher.

I just copied the output from that into the user_pass field, updated that database, and all was well.

Now, to make sure your loyal readers can find your stuff, you need to republish your old pages with a little redirect magic. I found something that I was able to make work for me. I used an HTML-based file structure: Alex King offers a solution for php and HTML-based sites, but his HTML one didn’t quite work. I had to make a couple of small changes (the complete file is below).

<!–

Template to redirect MT entries to WordPress
Copyright Alex King, http://www.alexking.org/
Released under GPL

–>
<?xml version=”1.0″ encoding=”utf-8″>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.1//EN””http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en”>
<head>
<meta http-equiv=”content-type” content=”text/html; charset=utf-8″ />
<title><$MTEntryTitle$> has moved…</title>
</head>
<body onload=”self.location.replace(‘http://change.me/wordpress/index.php?m=<$MTEntryDate format=”%Y%m%
d”$>/’);”>

<p>This post has moved to a new home as I’ve upgraded from MoveableType to <a href=”http://wordpress.org/”>Word
Press</a>.</p>

<p>If you’re not automatically redirected, click this link: <a href=”http://change.me/wordpressindex.ph
p?m=<$MTEntryDate format=”%Y%m%d”$>/”></a>.</p>

</body>
</html>

A lot of steps, perhaps, but in actuality, the republishing of your old material will take more time than anything else.

A couple of extra steps for your Apache config: put these in the stanza of httpd.conf that covers your DocumentRoot (for me, it’s “/www”).
Redirect /movabletype/index.xml "http://paulbeard.org/wordpress/wp-rss2.php"
Redirect /movabletype/index-full.xml "http://paulbeard.org/wordpress/wp-rss2.php"
Redirect /movabletype/index.html "http://paulbeard.org/wordpress/index.php"

Leave a Reply

Your email address will not be published. Required fields are marked *