Export Blogger Blogs to BlogML with PowerShell
I’m in the process of moving my blog from Blogger to WordPress, and I’m finding out just how important a project like BlogML really is. Most blog engines will integrate with a select few other engines to allow importing/exporting. What we really need is something just like BlogML – a standard format describing blog metadata that allows maximum interoperability. I’d love it if I could change my blogging engine periodically to get the best feature set for my ever-changing needs. But at this rate, the pain and effort is not really worth it.
My frustration led me to create a PowerShell script to export a Blogger blog to BlogML. Other methods exist, but they all required changing something about my blog, whether it was the template, or the hosting (and thus domain name). Not gonna happen. The script makes use of the BlogML .NET library (for ease) and the Blogger API. No Blogger login is required, you simply have to specify your “userid”. Your user id (it’s most likely public) can be found in your profile URL, like so:
Once you get that id, just run the script and pipe the output to a file. The output is actually an array of strings, each one is BlogML XML that represents a single blog. You can have multiple Blogger blogs associated with your user account–this will automatically download all of them. You can change the script not to do that if you need to.
To use it, type the following at the command line, I’m using my user id as an example (and I know I only have a single blog):
PS C:\Test> .\BloggerToBlogML.ps1 “17257708406345880368” | out-file aaronlerch.blogml.xml
Download the script here, or from my Garage Sale Code page. Let me know of any bugs or improvements I can make–I made it do what I needed, and not much more (the Blogger API is a little sparse anyway), but I’m happy to update it to include more if someone has a need.