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:
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
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:
- Change your Blogger settings so you're not publishing post-pages.
- Save your Blogger template.
- Change your Blogger template radically.
- Change your archive publish location (or change the name of the archive file, either can work)
- Run a full-publish, which gets the committed files updated.
- On your blogger host run the handy perl script I'll be posting below the fold.
- Copy the resulting files to your Movable Type import directory.
- In the Movable Type interface for your blog, do an Import.
- Review entries to make sure things look right.
- Publish entries in batches to post to the site.
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
First and foremost, go to Template and save your template somewhere safe.
Second, change your template to this:
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:
If you are doing this on the web-server, this could easily look like this:
This is scriptable.
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.
With luck, you now have your Blogger blog imported, complete with entries, labels, and comments!
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.
First and foremost, go to Template and save your template somewhere safe.
Second, change your template to this:
<blogger><ArchivePage>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.
EAUTHOR:::yourmtusername
ETITLE:::<PostSubject><$BlogItemSubject$></PostSubject>
EDATE:::<$BlogItemDateTime$>
EBODY:::<$BlogItemBody$>
<BlogItemComments>
CAUTHOR:::<$BlogCommentAuthor$>
CDATE:::<$BlogCommentDateTime$>
CBODY:::<$BlogCommentBody$>
</blogitemcomments>
</ArchivePage></Blogger>
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.
- Log in to MT as an Admin
- Go to your Blog
- Go to Tools
- Select Import
- The default values should be good
- Click Import
- Review the results page, you should see imported entries, categories (labels in Blogger parlance), and comments.
- Go to your Entries page to see what is there.
- Select-All, then click Publish to make it so.
With luck, you now have your Blogger blog imported, complete with entries, labels, and comments!
Looks good. Why did you pick MT over another option, like wordpress?
The two options I considered were Movable Type and Wordpress. The reasons were several:MT can use static HTML for each page, where WordPress is a fully dynamic. On a shared host like this one, MT can survive the runaway-process failure-mode much betterThe administration system is more responsiveOn a shared host like this one, I'm too cheap for a VPS or co-hosted server, surviving high load-averages is a big priority for me, so efficiency in rendering the high-traffic pages is paramount. MT is much better for that in my circumstance.People I respect use MT as well.