Google, who owns Blogger, provides tools to export your data from the platform. Information on how to export the data can be found here.
Ghost provides an interface that allows to upload blog posts from older installations. This interface can be used to upload content from other blogging platforms as well. All that is needed is a conversion script that takes the database from the old blogging platform and converts the posts into the Ghost input format.
Unfortunately, I could not find official support from Ghost to convert the Blogger XML format into their own JSON-based format. The Ghost wiki has a collection of unofficial tools that allow the conversion from different platforms into the Ghost format. There is also a tool that provides support for converting Blogger content into the Ghost format. It is called Blogger2Ghost and is also available as a web service for your convenience.
The web service did work for my old blog in principle. However, I found the results to be incomplete: Not all posts were extracted and converted. And those that were converted had a lot of formatting issues.
So, I decided to write a small little python script that converts an exported blogger XML file to the Ghost JSON format. You can download the code on github:
The code requires that you download your blog content from Blogger and run the script as
./blogger2ghost <blogger.xml> <ghost_output.json>
You can take the resulting file
<ghost_output.json> and load it at
under the input section:
This should import your old posts into your Ghost instance.
The code is a quick-and-dirty implementation that works for my use-case. The formatting from my old posts on Blogger were better conserved than by the ghost2blogger webservice. So maybe it does work for you, too.
Please note that the current code has several functional limitations, such as
- author information is not converted. All posts will be attributed to your Ghost default author
- no support for migrating tags
- images will not be included but will stay on blogger
- comments are lost
- conversion from HTML to markdown has some minor issues
- and probably many more things
Please feel free to fork and improve the code.