NOTE: This article is now out of date. Better notes on migrating from Movable Type to Drupal are documented on Drupal.org.
Why migrate
I migrated my MT blog to Drupal. It wasn't easy to make this decision, because I became used to the ease of use that came with MT in terms of setting up, administering, and blogging. I simply found that MT was lacking in some of the features and scalability I need, particularly with regard to classification and news feed aggregation. Since I've been using Drupal for the past year and extolling its features, I decided to eat my own dog food and use Drupal for my personal site. This way I can contribute to its development because I'll be looking at it more from the back side.
Migrating was not exactly for the PHP/MySQL novice -- which I consider myself -- so I wanted to document my experience for others who might consider the same move. I encourage anyone who decides to go with Drupal to please consider becoming part of the development list and get involved with helping evolve the application. Drupal is very developer/programmer-centered application at the moment, catered to technical people, but if non-technical people or people who demmand ease of use and uasbility begin to add their voice to the development list or to the Drupal web site forum, perhaps the administration experience will improve. I hope to throw some time into making these types of contributions in the future.
So here's how I migrated (this is being updated presently):
Methodology
Overview
- Prepared IA for site in order to move all static and MT content into Drupal CMS. Will explain this further as I get time.
- Prepare index templates in MT to dump blog records as complete MySQL INSERT statements for Drupal's node table.
- Prepare index templates in MT to dump categories as complete MySQL INSERT statements for Drupal's term_node table. (Follow-up: I decided to forego this step and re-index everything as I changed my taxonomy. I also had some difficulty with removing index terms. Will explain this later.)
- Create RedirectRules in .htaccess to forward browsers going to old MT URLs so they will see new Drupal URLs
- Pending: Import old comments and insert as anonymous. Not sure if I want to do this yet.
- Pending: Create "story" pages for all static content I had in Papers, Projects and Portfolio sections.
- Pending: Think about how to migrate links from Gossamer Threads into weblink module. Not sure this is worth doing because of the categorization mapping. May just clean these out and enter by hand, which might be a hassle because there are a lot of records.
1. Information Architecture
My strategy regarding organization of site content was to use Drupal's taxonomy features to separate content along different attributes. I imposed a section/category structure that will inform global navigation. These are general rubrics that describe types of content. I then used these rubrics as terms in a taxonomy/controlled vocabulary named "Category".
Category terms:
- Weblog
- Papers
- Projects
- Portfolio
These Category attributes are used to make up the global navigation. I made links in the global navigation point to those pages which match terms from that taxonomy. For example, the Weblog term has an id of "4", so the URL for that global navigation link is: index.php?or=4.
I then wanted an additional attribute for describing content, regardless of where they fit into the categories. So I created a new taxonomy/controlled vocabulary called Subject. I apply terms from the Subject taxonomy to content so that one can browse/find related content. I display the entire subject taxonomy on the home page and display subject headings attributed to each content node.
2. MT Index template to create MySQL import file for Drupal.
I basically created an MT template that is saved as php file -- just named it dump.php. After it gets rebuilt, I viewed the source of the file in IE and then saved it on my server. Then I loaded the file into MySQL using:
mysql -h[host address] -u [user name] -p[password] [database name]
3. Category dump
I decided not to actually use this because I changed my categories significantly in the Drupal system, but here's how I set up the category dump MT index template.
Map the MT category labels to the new Drupal category IDs and assign variables. Save and rebuild the MT index template. View the source on the built file and load into MySQL.
<MTEntries author="jibbajabba" sort_order="ascend">
<?php
$cat = '<$MTEntryCategory$>';
if ($cat=='Subject » Parenting'){$drupalcat='3';}
if ($cat=='Subject » Silliness'){$drupalcat='38';}
if ($cat=='Subject » Site development'){$drupalcat='2';}
if ($cat=='Subject » Scripting'){$drupalcat='37';}
if ($cat=='Subject » Design'){$drupalcat='36';}
if ($cat=='Subject » Art'){$drupalcat='42';}
if ($cat=='Subject » Information architecture'){$drupalcat='1';}
if ($cat=='Subject » Musings'){$drupalcat='43';}
if ($cat=='Subject » Notes to self'){$drupalcat='43';}
if ($cat=='Subject » Politics'){$drupalcat='41';}
?>
INSERT INTO term_node (nid, tid) VALUES (<$MTEntryID$>, <? echo $drupalcat ?>);
</MTEntries>
4. .htaccess in old directory with RewriteRules
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^weblog/archives/000(.*).php /drupal/node.php?id=$1 [R]
</IfModule>