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:
- Replacing your Blogger template with one that formats your data in a way that Movable Type will understand.
- Changing your Blogger settings to produce one very large file containing all your data.
- 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.