Movable Type Upgrade Panic
Monday, August 27th, 2007The longer you have a blog the harder it gets to upgrade your blog software. With hundreds of entries and thousands of comments you have a lot to lose if something goes wrong. That is why I have been hesitant to upgrade to the new version of Movable Type (4.0). I waited until I had a free weekend and enough time to do everything right. I uploaded all the new files and ran the upgrade script and got the following:
Upgrading database…
Upgrading table for TrackBacks records…
Upgrading database from version 3.3.
Upgrading table for Job Exit Status records…
Upgrading table for Asset records…
Upgrading table for Asset Placement records…
Upgrading table for Job Function records…
Upgrading table for TrackBacks records…
Error during upgrade: failed to execute statement CREATE TABLE mt_log ( log_id integer NOT NULL PRIMARY KEY auto_increment, log_author_id integer DEFAULT 0, log_blog_id integer DEFAULT 0, log_category varchar(255), log_class varchar(255) DEFAULT ’system’, log_created_by integer, log_created_on datetime, log_ip varchar(16), log_level integer DEFAULT 1, log_message mediumtext, log_metadata varchar(255), log_modified_by integer, log_modified_on datetime ): Table ‘mt_log’ already exists at lib/MT/Upgrade.pm line 1855.
I didn’t know what any of that mean, but it was obvious that the upgrade failed! That is when I started to panic. Had I lost everything? I desperately searched for anyone experiencing the same problem with out luck.
As a last resort I decided to look at my MySQL database and see if I could tell what was wrong. I logged in to PHP MyAdmin (something I know nothing about) and I noticed that the mt_log table said “in-use.” That seemed strange. One of the options was to “Repair-table.” I wasn’t sure what that would do, but I was desperate enough to take a chance. I repaired the table and reran the Movable Type upgrade script. To my great relief it worked without errors!
I am writing this post in case it helps somebody who has the same error when upgrading to Movable Type 4. My advice is to back up your database before you upgrade. You never know what is going to go wrong. Oh, and Movable Type 4 is pretty cool. The best new feature is that you can add “pages” similar to Wordpress. It is pretty nice but I am still on the fence about which is better between Wordpress and Movable Type.

If you are a Simpson’s fan and you haven’t heard about the