From MT to WP: Using the Same Permalinks as Movable TypeSubmit to del.icio.us | digg it! | Submit to Slashdot
Like I mentioned previously in the system overhaul post, I switched blogging software from Moveable Type to WordPress. Let me tell you, it was a lot of work! Luckily, I found many outstanding tutorials that told me how to properly convert my MT posts into WP posts. I found most of my information in the Wordpress Codex from Importing from Movable Type to Wordpress. (If you need any help doing the same thing, they have great links at the bottom of the latter page.)
Though, there was one huge problem that I met along the process. Movable Type has a different naming convention for their URLs then Wordpress. Movable Type’s nomenclature is something like this (at least, this is how mine works):
On the other hand, Wordpress uses something like this:
Now, I could easily modify Wordpress to utilize permalinks just like my previous Movable Type installation. I just input this string into the “Edit Permalinks Structure” page (under “Options”):
But there are two problems
WordPress does not have a native way to switch the dashes to underscores in the permalinks. Luckily, I found a great plugin that does it automatically. It is located in the Wordpress Codex.
This was a harder problem to solve. By default, Wordpress leaves the basename length as the entire length of the title. So, if my title were
I Really Love to Eat Bananas in My Apartment Which is in New York on the Other Side of the World as China
Then the entire URL would be
There were many solutions posed in working around this problem. But most of them pretty much suggested to program the Apache Rewrite engine to redirect posts. I didn’t want to do that. I wanted the WordPress URLs to be the exactly the same as my Movable Type URLs. Then, I read this obscure post from the WordPress Forums. It was an ingenious little idea of importing the Movable Type posts, and then changing the Permalinks by way of a mySQL query. This would then keep the permalinks of the imported posts the same as they were previously. But, any post that will be made by Wordpress will follow the unlimited character rule.
Run this sting the mySQL query interface (which is usually phpMyAdmin). Change 15 to the number of character you want in the basename.
UPDATE wp_posts SET post_name=SUBSTRING(post_name,1,15)
Remember to backup your databases before running this query.
I checked my 404 error log (for non-existant-page requests) and I still found a few. Apparently, Movable Type randomly used 15 or 14 for my basenames. But, it may be different for your MT installation. Good Luck!
Posted on Friday, December 9th, 2005