Follow tomcoates on Twitter
A weblog by Tom Coates concerning future media, social software and the web of data
Quote of the month: "This is not a brothel, there are no prostitutes here"
You can explore the archives, read the disclaimer or subscribe to an RSS feed

Hacks: Upgrading to Movable Type from Blogger

Posted June 23, 2003 10:09 PM.

The instruction manual for Movable Type contains detailed instructions about transferring your weblog from Blogger and Blogger Pro, and these instructions work extremely well if you have not been maintaining your site for very long. But while it's rare for there to be a problem with the importing process, exporting weblogs from Blogger isn't always so easy.

The normal transferral process is essentially three stages:

  1. Replacing your Blogger template with one that formats your data in a way that Movable Type will understand.
  2. Changing your Blogger settings to produce one very large file containing all your data.
  3. Inserting that file into Movable Type's import directory and pressing the import button.

Stage one is the simplest stage and presents no problems. You simply copy this text into your Blogger template page:

<Blogger>
AUTHOR: <$BlogItemAuthor$>
DATE: <$BlogItemDateTime$>
-----
BODY:
<$BlogItemBody$>
--------
</Blogger>

If you are using Blogger Pro, you should add the title tag to your template so that it reads like so:

<Blogger>
TITLE: <PostSubject><$BlogItemSubject$></PostSubject>
AUTHOR: <$BlogItemAuthor$>
DATE: <$BlogItemDateTime$>
-----
BODY:
<$BlogItemBody$>
--------
</Blogger>

Click to save the template, and you're done.

Stage two is a little trickier. Firstly you change your Blog Filename to something other than the name you normally use. This is just so that you don't over-write your normal front-page while exporting. Then you set the Date/Time Format to the format MM/DD/YYYY HH:MM:SS AM|PM and turn off Convert Line Breaks.

There are two other things they tell you to do in the instructions and these are (in Archive Frequency) turn your archives off and then (in Formatting) set the 'Show N days' posts on main page' to be higher than the number of days you have posted. At this point if you publish your blog, you're supposed to get one massive file containing all your posts.

Unfortunately this often won't work if you've been weblogging for a while. Firstly, you can't put a number into 'N day's posts' field that's in excess of 999 days, which is a bit less than three years worth of posting. Secondly, even when it finally publishes the file, it is likely not to actually include even that three years of posts. In fact, you're more likely to get around one year's worth of exported content.

In fact the best way to import files into Movable Type turns out to be by renaming and republishing your 'archive' templates rather than your main template. If you transfer all of those over into the import directory instead of your main page, Movable Type doesn't seem to have any trouble importing them all in one go, and Blogger has considerably less trouble generating the pages.

The only other thing to bear in mind is the number of Movable Type entries. Movable Type will number your entries in order of file name and then from the top of the page down. If you manage to export everything from Blogger in one go, then the layout means that the most recently created post will be given assigned the MT post number 1, with each subsequent post's number increasing incrementally even as you go back in time. While your posts will always be displayed in date order, this post numbering can be confusing. You might wish to explore ways of reversing the order of the posts in your import file. This is particularly true when you're importing from multiple archive templates, as it will start with the earliest dated file, and then with the oldest (first) within it - effectively completely messing up the order of you posts... Either way, good luck!

This hack was originally supposed to appear in the ill-fated O'Reilly "Blogging Hacks" book. I'll be putting all my contributions online over the next few days / weeks.

Comments

Please stay on-topic, informative and polite. I reserve the right to remove comments for whatever vague capricious reasons seem reasonable at the time.

Tom,

Thanks much for posting this. I'm currently in the process of making just such a transition and this is a very helpful addition to the MT instructions. One thing that worries me is that something might be different with the New Blogger Pro. Blogger recently switched my blogs to the new.blogger servers and (with Bloggers track record) I fear something will become severely screwed in the process. Anyone had any problems with the New Blogger switch to MT or is it still too early for a report?

Posted by: Eric J at June 23, 2003 10:56 PM

Tom - thanks for the helpful hack. I may well be struggling down the migratory path from Blogger to MT very soon, as Onlineblog outgrows Blogger Pro, and I'll certainly use this for reference. But one (perhaps slightly daft) question: is there an over-riding reason why we should move archives over to MT, other than for neatness? Is leaving the archives as static HTML pages not an option too?

Posted by: Neil McIntosh at June 30, 2003 3:24 PM

The main reason to move your archives is so that you can rework and redesign your whole site in one go from one interface if you decide you want to. It also lets you do things like use MT Search as your site's search engine rather than having to run another one over the top. Basically, you want to keep your content in a content management system because it just makes it easier to ... manage!

Posted by: Tom Coates at December 10, 2003 5:27 PM

Recently, Blogger Pro was discontinued and title capability was integrated into the regular free version of Blogger. If, like me, you've been using this for you Blogger posts (the way to tell is if there's a seperate one-line field in your "Add Post" page or "BlogThis!" window for titles), then your template should look like this:


TITLE:
AUTHOR:
DATE:
-----
BODY:

--------

I've only tested with with MT v3.15, but since Blogger is by definition always up-to-date, this should always work fine.

Posted by: Ernie at February 4, 2005 8:57 AM

Ancient post I know. But Google still finds it for MT noobs like myself.

On to my tip: Instead of publishing the blog from Blogger to get your dump you can also just preview the template once you have made all the setting changes. The preview will have the same thing as a publish will without risking mucking up your existing blog. This imports fine into MT.

Enjoy!

Posted by: Volksman at February 21, 2005 9:39 PM

If you want to stay with blogger, I have a post at blogger hacks: the series, a growing list of add-ons, bookmarklets and template tag combinations that can make blogger more fun, more interesting and more interactive. There's stuff there about categories, but plenty of other goodies too. Check it out, and leave your hack in the comments or ask me to link to it.

Posted by: John at August 30, 2005 1:14 AM

Not much on my mind these days, but what can I say? It's not important. I just don't have much to say lately. I've just been letting everything pass me by recently, but eh.

Posted by: Kaka51204 at July 11, 2006 9:20 AM

I'm having a lot of trouble with this and I'm not sure if it's because of Blogger or not... I use the FTP method where I rebuild the Blogger site and I get a html page (that I convert to txt before putting it in the import folder) for each month. Now when I import those into MT, then MT only imports one post from each month. Bizarre behaviour... any suggestions? Contact at antiboy@gmail.com would be nice... thanks in advance!

Posted by: Chris at August 14, 2006 6:03 AM

Actually it's possible to show all posts from blogger at once by searching and changing the parameters a little. Try out an url like this:

http://username.blogspot.com/search?updated-min=2000-01-01T00%3A00%3A00%2B01%3A00&updated-max=2012-01-01T00%3A00%3A00%2B01%3A00&max-results=999

I don't know how far the values can go, so be careful with the values. These were not even the exact values i used, so it might be that they wouldn't work, but i'd think they will. Just change the min and max dates and the max results.

Posted by: KB Jørgensen at March 7, 2007 11:43 PM

this probably doesnt work with the new blogger update. Am I wrong ? Can anyone help me out here ?
-thanks

Posted by: asd at June 21, 2008 12:17 AM

Want to add your opinion?

© 1999-2007 Tom Coates