Converting From PHP-Nuke to Movable Type

Friday, February 20, 2004

We are in the process of redesigning the Mensa web site. One of the main purposes of this go ‘round is to rid ourselves, once and for all, of PHP-Nuke. I’m replacing it with Movable Type, which will come as no surprise to anyone who has every read this blog before.

I’ve wanted to do this for some time, but the job of porting all those old posts—460+ at last count—was daunting. I searched the web several times, and never found any information from anyone who had done it before. With a deadline looming (I really need to get this done by March), I decided to just sit down and do it.

It took about 10 minutes of analyzing the Nuke database structure, another 10 studying the MT import format, and another 10 writing the actual script. Probably the reason no one has written about it is because it is so easy to do. On the off-chance, however, that someone will need this again sometime, here is the code.

Unzip it, open the php file in a text editor, and read the instructions at the beginning. When it runs, it creates a plain text page with all your Nuke posts and their comments in the MT import format. Save as a text file, then follow the MT import instructions.

A few things you should know about this:

  • It was built to solve a very specific problem. As such, there is probably a lot more it could do, such as moving over reviews, links, or any of that other PHP-Nuke stuff you thought you would use, but you didn’t. It has served my purposes, so I will not be adding any new functionality to it. If you need it to do more, you will have to modify it yourself.
  • This has only been tested with PHP-Nuke 5.2 and Movable Type 2.661. It will work with any version of MT that supports the current import format. I have no idea, nor do I think my stomach could handle, what other versions of Nuke look like, so I can’t say if it will work with them.
  • The sid of the post is placed in the “Keywords” field in MT. That way, you can set up something to redirect visitors following old links.