How to upgrade to Movable Type 4 full templates (MT4)

Last week, Six Apart announced the release of Movable Type 4. MT4 is a major upgrade in that it adds many new features and supports a more robust templating system. This site is run by MT4 and has been upgraded from version 3.35 to use the new templates and features. (Edit - 2-25-2009 - this site is now running drupal 6.9) Upgrading the underlying system is fairly straight-forward, but getting all of your customizations moved into the new templates is very work intensive and requires a lot of research. I'll go over what I learned and did to successfully upgrade this site and hopefully save you some time.

Upgrading the base system

Most people can just follow the directions in MT's documentation for upgrading.

On my system, I had to migrate from Berkeley DB to MySQL, which involved installing several Perl modules to support MySQL connectivity. There is some good information for installing MySQL extensions for Perl here. After I had set that working, I had to convert my existing MT 3.35 Berkeley DB database to MySQL using these instructions.

Even though I was able to write this using 3 links and under 200 words, the instructions up above required over an hour of work. Make sure to back up during every step so that if you make mistakes (and you very well might!) you don't lose any part of your precious site.

At this point, you should have MT4 installed and your previous site should be working in it. While many people may think this is good enough, it's not really much of an upgrade as you don't get to use any of the new features available in Movable Type 4. Six Apart gives some basic directions for upgrading MT3 templates, however they only offer enough to get some of the new features working with your old templates and end the article by saying that a full upgrade is only for the brave at heart. If you are, read on...

Benefits of converting your site's design to the MT4 templates

  • MT4 Styles
  • Immediate use of new features
  • Easier management long-term
  • Better organization

Updating to the new templates

What I did first was created a brand new blog, called "new blog", that would have all of the default templates and settings I was hoping to integrate into my old upgraded site. Then I made a clone of my site called "clone." I did this so that I could have an old template point of reference, a new point of reference and a merging and testing area that shows how the site will look using my current entries. Once all is said and done, you will end up moving your clone's templates back over to the main blog and republish using those. We'll get there at the end.

Visualize this process as:
Blog (Old Templates) --> Cloned Blog (Merged Templates) <-- New Blog (New Templates)

Then:
Merged Templates --> Replace Old Templates

Copy the new blog's templates over the clone's

Note - See comments below on quicker ways for refreshing the templates. Apparently a standard "refresh templates" will get the new templates up, but you still need to set up archive mappings.

Open up the Index Templates list on your clone blog. These are all wrong now, and we still have your original blog so it's time to clear it all out. Delete them all by selecting all and hitting delete. Repeat for Archive Templates and Template Modules. Open up another browser window or tab with the new blog's Index Templates. Create a new template in your clone blog for every template you see in the new blog, name it the same as the new blog, make sure to set it's type on the pull-down on the bottom to match then paste the contents in and save. Repeat for all Index Templates and Template Modules. Archive Templates are a little different because they have archive mappings on the bottom that you must create. Perform the same name and content pasting as before for these but make sure to create the archive mappings to match as well.

Now you will have a clone of your original blog using the new templates, but you've got none of your customizations. It's time to learn a bit about how MT4 does templates and do some thinking about how you'd like to redesign, if at all. Republish your clone and have a look. It should be all of your content, all functional but with the new default style. To change the style, Go to Design -> Style in the admin tool, choose a style and apply. Sift through the new templates and template modules to understand the way they are included and compartmentalized. This will help you merge in the next step.

How to merge old templates with new

Open up three browser windows or browser tabs, one with the old templates, one with the clone (merge) templates and one with the new templates. For every bit of custom design you had and still want, you will have to find the old spot you have customized in the old templates, the new spot that it belongs in in the clone templates and make that change in the clone template. Many things have moved around and become better organized, such as the new header, 3 column layout and footer, available in the Template Modules. Go through each customization one at a time, copying from your old blog and pasting in to your clone blog, then republishing and viewing to see if it produced the desired effect. Eventually you will have integrated your old changes, made some design changes and become satisfied with your clone blog's layout and functionality.

At this point, all you need to do is back everything up (Can I say backup again?) and perform the same template copy procedure you have done once already but this time you are copying from your clone blog back to your new. Don't forget to set up archive mappings! Republish and your main blog should have a shiny new exterior on it.

Tips and Tricks for converting

  • The old module-content and module-list CSS classes are now widget-content and widget-list
  • Scan through your Template Modules if you can't find what you are looking for
  • The Header and Footer are used on all HTML index templates and archive templates
  • The 3 column layout template module contains most of the template code you will want
  • If you can't get your head around where everything is coming from, write down the part you're working on and make a tree on paper of what you see being included, what's included in that and so forth. Eventually the big picture will come together for you. 

15 Comments

Post a comment here or discuss this and other topics in the forums

Not sure if you noticed but I

Not sure if you noticed but I quit running MT about 4 months ago. I do everything in Drupal now because it's far more powerful.

Old comments

I'm doing okay since migrating to 4X from 3X, except I can either display all my comments with awful formatting, or just display the comments I've added since the change, formatted properly. Any idea on the least painful way to do this?

Great post, it's been a huge help, I'm just not MT-hip enough to go the last 10%. Please leave a comment at the blog, or email me at pragmatic.chef AT thepragmaticchef DOT com. Thanks.

re: How to upgrade to Movable Type 4 full templates (MT4)

I found these instructions from a Google search and they helped a lot. Thanks!

re: How to upgrade to Movable Type 4 full templates (MT4)

I have always triedto get away from the duplicate content. Just not worth using it.

re: How to upgrade to Movable Type 4 full templates (MT4)

This was a great tip. I have it working about 80% of the way, even though MT support told me it was nearly impossible to get blogs from 3.3x to work with 4.0x templates without extensive work (yikes)!Again, the only problem seems to be the archives. Even with the stylesheets pointing to the appropriate spot, the formatting is off, and I don't have enough experience yet to mess around with too much of the other things.Soooooo close...

re: How to upgrade to Movable Type 4 full templates (MT4)

I took a quick look but am not totally sure what's wrong there. Maybe do a "refresh template" on the archive template and see if that helps any.

re: How to upgrade to Movable Type 4 full templates (MT4)

Thanks! -I got most of it working with the templates, but the individual entries (where the Permalink link goes in the template I'm using (minimalist white) still looks awful - any ideas?

re: How to upgrade to Movable Type 4 full templates (MT4)

Not a problem. I should have taken a screen shot of this. When you edit an archive template (Individual, List, etc) you will see a combo box on the bottom of the page for "archive mappings." These mappings are the output files that this archive template will be put in to. You must set those up to get your individual, author and other archives published.

re: How to upgrade to Movable Type 4 full templates (MT4)

Thanks for the great post, which is helping me a lot!I have a question, though -I got the clone blog up and running and refreshed all the templates, which worked fine, but the archives look awful.I couldn't figure out what you meant by:"Archive Templates are a little different because they have archive mappings on the bottom that you must create. Perform the same name and content pasting as before for these but make sure to create the archive mappings to match as well."Can you add some more detail on what you mean about archive mappings?Thanks!

re: How to upgrade to Movable Type 4 full templates (MT4)

What are you on about? I installed the new MT4, a completely fresh install with its own templates and all.Then I imported just my entries text from the old install.Now I have category, category monthly, and index pages, but no individial archives! No comments! It just points me to the category archive with a "#xxx" anchor for each posting!Is this the new "upgrade"??PS. Btw, the captcha is very hard to read.

re: How to upgrade to Movable Type 4 full templates (MT4)

Hi,I would really appreciate it if you can post a comment on how you made captcha work on mt 4?? i tried everything with no success and yes imagemagick is installed...Thank you for any help that you can provide.

re: How to upgrade to Movable Type 4 full templates (MT4)

They tell you how to refresh your templates here:Refreshing your Blog's Templates from the System Defaults:http://www.movabletype.org/documentation/designer/refresh-templates.html

re: How to upgrade to Movable Type 4 full templates (MT4)

Robert - you might have found this by now - but rebuilding (actually refreshing) templates is done on any of the template listing screens. Just go to the "More Actions" dropdown and select "Refresh Template(s)".If for some reason this isn't showing up for you, check your plugins at the system (not the blog) level - you need to have the Template Backup and Refresh plugin enabled.

re: How to upgrade to Movable Type 4 full templates (MT4)

Joel, I tried to test this and was unable to find a rebuild-templates feature. Is it on the dashboard or where is this function available?

re: How to upgrade to Movable Type 4 full templates (MT4)

You don't have to hand cut-and-paste all the templates in. You can just delete all the old ones, then rebuild the templates from the top-level blog menu. You still have to map the archives, though.

Post new comment

The content of this field is kept private and will not be shown publicly.
Add image
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td>
  • Lines and paragraphs break automatically.
  • Images can be added to this post.
  • Image links with 'rel="lightbox"' in the <a> tag will appear in a Lightbox when clicked on.
  • Image links with 'rel="lightshow"' in the <a> tag will appear in a Lightbox slideshow when clicked on.
  • Links to HTML content with 'rel="lightframe"' in the <a> tag will appear in a Lightbox when clicked on.
  • Links to video content with 'rel="lightvideo"' in the <a> tag will appear in a Lightbox when clicked on.
  • Links to inline or modal content with 'rel="lightmodal"' in the <a> tag will appear in a Lightbox when clicked on.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.