Migrating from blogger, a guide

| 2 Comments
Migrating from Blogger took a few steps. The steps any new Movable Type installation has to go through aren't important, and you really don't need to know about what all I went through to get the theming right (learning CSS along the way) or a strange publishing fault fixed. Not relevant, and really well covered out there on the Internet.

No, what isn't well covered is how to move an FTP-hosted blogger-blog to MT. There are a few resources out there, but nothing automatic. Two sites started me on the path to what ultimately worked. However, none of them covered how to import existing comments. It isn't easy to do that as I found out, but it can be done.

The steps are in abstract:
  1. Change your Blogger settings so you're not publishing post-pages.
  2. Save your Blogger template.
  3. Change your Blogger template radically.
  4. Change your archive publish location (or change the name of the archive file, either can work)
  5. Run a full-publish, which gets the committed files updated.
  6. On your blogger host run the handy perl script I'll be posting below the fold.
  7. Copy the resulting files to your Movable Type import directory.
  8. In the Movable Type interface for your blog, do an Import.
  9. Review entries to make sure things look right.
  10. Publish entries in batches to post to the site.
The perl script takes the files published by blogger and massages them into a Movable Type export file.This is the step the other instructions don't have. Unfortunately for the masses, the FTP channel dies on March 26th May 1st, so these instructions have a timeout value.

The other thing I learned along the way is that you really don't want your comment templates to be server-side-include files. Really, keep 'em static.

The script: blogger2mt.pl
As for the details, here is what I did.

Blogger Settings Changes
  • Under Settings -> Formatting, make sure your Timestamp setting is MM/DD/YYYY HH:MM:SS AM/PM format. 
  • Also under Settings -> Formatting, don't change the "convert linebreaks" value from whatever you have set. This goes against other instructions.
  • Under Settings -> Comments, make sure your Timestamp setting is MM/DD/YYYY HH:MM:SS AM/PM format.
  • Under Settings -> Archive, set Archive Frequency to 'Monthly', and "post pages" to off (this'll save time on the publish)
  • Under Settings -> Archive, either change the value of "Archive Filename" or change the "Archive Path". Either will work.
Blogger Template Change
First and foremost, go to Template and save your template somewhere safe.
Second, change your template to this:

<blogger><ArchivePage>
EAUTHOR:::yourmtusername
ETITLE:::<PostSubject><$BlogItemSubject$></PostSubject>
EDATE:::<$BlogItemDateTime$>
EBODY:::<$BlogItemBody$>
<BlogItemComments>
CAUTHOR:::<$BlogCommentAuthor$>
CDATE:::<$BlogCommentDateTime$>
CBODY:::<$BlogCommentBody$>
</blogitemcomments>
</ArchivePage></Blogger>
Change the value of "EAUTHOR" to whatever you've named your username in Movable Type. This way when everything imports, it'll all belong to the correct user in MT.

What this is doing is exporting your blog into a custom format. This is the format needed by the script.

Publish the blog
Do a Publish All on your blog. This will update your Archive data.

Gain access to the Archive data
SSH into your web-server, or ftp down the archive data. Whichever. However you do it, grab the files that were published in the previous step into an area you can process them with the perl script.

Run the script against the files
The command is very simple:

perl blogger2mt.pl infile outfile

If you are doing this on the web-server, this could easily look like this:

perl blogger2mt.pl ~/public_html/blog/archive/2010_01_01_export.txt ~/public_html/cgi-bin/mt/import/2010_01_01_export.txt

This is scriptable.
for file in *.txt; do perl ~/bin/blogger2mt.pl $file ~/public_html/cgi-bin/mt/import/$file; done

The output will be Movable Type formatted Export files.

Import the entries
You would be wise to try this on a single file first, rather than doing it all at once without trial.  This can underline faults in your template that you can fix without having to republish umpty thousand entries like me.You have been warned.

  1. Log in to MT as an Admin
  2. Go to your Blog
  3. Go to Tools
  4. Select Import
  5. The default values should be good
  6. Click Import
  7. Review the results page, you should see imported entries, categories (labels in Blogger parlance), and comments.
  8. Go to your Entries page to see what is there.
  9. Select-All, then click Publish to make it so.

With luck, you now have your Blogger blog imported, complete with entries, labels, and comments!

2 Comments

Looks good. Why did you pick MT over another option, like wordpress?