Importing From B2 To Movable Type

This How-To was updated on May 6, 2003 and then again on September 4, 2003 and again on June 4 2004. Given it’s age, this information is no longer relevant. I’m keeping it up here for historical purposes.

Here’s some code I wrote after getting involved in a discussion at the MT Support Forum. If you’re a MT user and you don’t read their forums, you’re only hurting yourself!

Many WordPress users visit this page hoping to migrate to MT with the help of this script… a visitor here named “seraph” tells us that the current version of WordPress uses a slightly modified database schema which keeps my script from working as designed:

all posts in recent versions of WP have posts set to 0 in wp_posts table, and there is a separate wp_post2cat table that links post IDs with category IDs.

Until i get a spare weekend to install WordPress and rework my SQL, I’m afraid you WordPress users will need to search elsewhere for your export/import needs.

This PHP script will read your B2 CMS entry, authors, and comments tables and format them for easy importation into Movable Type. Important note: all three B2 table must exist in your database or this script will not work! Please follow these directions closely:

1. To use this script, your host must allow you to run PHP scripts. Since you’re trying to import a B2 blog, this is probably not an issue (but I thought I’d mention it anyways).

2. Click here to view this code in another window.

3. Copy and paste ALL of the code into a new file and save it as export.php on your web-server.

4. Edit export.php to reflect your database info (your host, your login, your pw, etc).

5. Open a browser window and point to your copy of export.php.

6. Select the view source option from your browser’s menus.

7. Copy the source to another file and save that file in your import directory (as described in the MT import documentation. You did read the MT documentation, right?). Name the file something catchy, like import.txt.

8. IMPORTANT: Delete the first line of the file (it should be the line that has eight dashes )

Four Popular CMSs

I’ve said it before, but it bears repeating: I am a geek.

I am a geek and I like to play with code, so it’s natural for me to write about something that has occupied a lot of my spare time over the past four months… website Content Management Systems. CMS’s are an easy way for you to setup, manage, and publish sophisticated-looking web sites chock full of content. With the proliferation of “the Blog” as a popular website format, CMS’s are in high demand. A good CMS can be the key to making yourself known on-line, but choosing a CMS can be difficult and installing the right CMS is often the hardest part of the process. What follows are my views and opinions on four well-known CMS options available to the general public: B2, Nucleus, Blogger, and Movable Type.


B2 is a PHP-based CMS that utilizes the MySQL database to store author and post data. I currently use B2 at, so I can admit right off the bat it’s a good system and worthy of your time. The value of a CMS can often be judged by it’s user community, and B2 really shines in this regard. Their site posts info about updates on a regular basis, they have a well-traveled discussion forum, and B2 is a registered SourceForge project.

B2 behaves like a good CMS should; it offers multiple post categories, multiple authors (for that big blog team you’ve built up), user management for the blog owner, a comments feature, web-based template editing, and an attractive web interface to ride herd over all these elements. The main issues that drove me away from B2 as the CMS for was the lack of organization within the directory structure and code base. When it came time for me to edit my templates and adjust the look and feel of the web site, I just didn’t feel like I was working with a thought-out and mature stack of code. Blame it on the geek in me, I guess.


Nucleus is the CMS I tested after deciding that B2 wasn’t meeting my needs, and my initial thoughts were very positive. After you’ve worked as a developer long enough and you’ve hung out with other developers, you start to realize that, much like any other author, a person’s personality actually manifests itself in the lines of code that they write everyday. Nucleus has a discernible difference from B2 in its look and feel, and it was a difference that made me comfortable. Three months after I initially installed it I can go to the Nucleus site, look at their screen shots, and see that somebody applied a level of logic and reason to the project.

Unfortunately, Nucleus only found a home on my server for a short time. It did everything I told it to do, but it did it in a very logical and unsexy way. That’s right, I said unsexy. I do what I do because it’s fun, and if something isn’t fun enough (and there are other options that are way more fun) I may be inclined to opt for mo’ fun. is the ubiquitous starting point for thousands of web loggers, and even though it provide only the barest CMS features it should never be discounted as a valid resource in the realm of web publishing. The fact that you can hit and create AND host a fully-functional blog for free should not be taken lightly. In the CMS dance I’ve been party to over the past three months, I’ve gone from to B2 to Nucleus and back to… surely that’s evidence of it’s value to me (at least). But sadly, I have parted ways from once again; the aforementioned lack of features raised it’s ugly head and my geek-minded curiosity got me wondering about a CMS that I attempted to use a long time ago…

Movable Type

Movable Type first tempted me early in it’s release cycle, but I don’t remember anything about my first taste of it except for two things:
1. it looked sexy (see above)
2. i couldn’t get it to run for anything
Combined, these two points made me very frustrated… I’m glad I made it back to MT, however AND I’m glad I avoided the installation mistakes I fell into in the past (hint: don’t install it in your cgi directory).

MT has all the features you could want in a CMS, and then delivers them in spades. The snappiest administration interface, a flexible template system, and cool bells and whistles like XML feeds, track-backs, and pings (that work immediately and without bugs) are all element that grab and hold your attention. On a more nuts-and-bolts level, even though MT is installed on your host and utilizes a MySQL database (just like B2 and Nucleus) it does not render your content dynamically (that is to say, it doesn’t hold all the data that makes up your blog entries in the database and construct your pages on the fly as people browse from page to page on your site); after editing a template or making a new post, the MT interface prompts you to “rebuild” your page/site so that the most current version resides statically on your web site. Pundits will debate endlessly the pros and cons of this technique vs. a totally dynamic site design, but everyone can agree that there’s a certain amount of security on not being dependent on an $8.95/month overloaded shared hosting server to dish out your content when your blog gets /.‘ed.


Movable Type currently holds a high place in my mind, but that’s not to say I feel like I’ve been to the top of the mountain… I’m always looking for that next big cool thing to come down the pipe and I’m not afraid to jump ship even if it means I’m going to get soaking wet. Blogging is an important part of thousands of peoples lives, and eventually companies like AOL and Microsoft will start building CMS-style capabilities into their entry-level consumer products. Having a blog will be like having an answering machine; your friends will get mad when they can’t leave you comments and your kids will be embarrassed if your blog isn’t “cool enough”. Don’t be afraid to be an early adopter of these CMS options, or any of the other many CMS’s available right now.