Bill on the Soldersmoke blog posted recently with some concern that one day Google might lose interest in their free blogging platform Blogger. I share his concern and wanted to assure myself that there's a way to move all of my posts, images and comments to something else, most likely Wordpress, if suddenly required to.
After much searching around there don't seem to be many options. One is a promising looking Wordpress plugin btw-importer by mnasikin. It's not in the plugin directory but you can download the zip and install it.
This is probably the way to go in the end but currently it doesn't migrate comments. I've reported a few bugs and mnasikin has been very responsive. He even accepted a tiny pull request from me to at least skip comments for now, rather than turning them in to posts.
Wordpress has a very nice REST API and I can see some python code around that makes a nice wrapper for it. I asked Anthropic Claude to write me python to read the Google takeout feed.atom file and migrate posts, images and comments over to Wordpress and it did a pretty good job. I fixed a few bugs but it's working well enough to be a good start.
I've stuck my (our?) code up as a Github gist: blogger2wordpress.py and I hope it helps someone (maybe future me).
Here's a migrated post:
Here's the comments:
Looks pretty good although, undoubtedly there are bugs.
Update: Blocked by Mod_Security
I tried all this on an Ubuntu virtual machine at home and it worked fine. When I tried on a hosted Wordpress site I got this error:
Processing entry 9/20: Why the 30 Meter Pipeline to Norway?
Error creating post: 406
Response: <head><title>Not Acceptable!</title></head><body><h1>Not Acceptable!</h1><p>An appropriate representation of the requested resource could not be found on this server. This error was generated by Mod_Security.</p></body></html>
✗ Failed to create post: Why the 30 Meter Pipeline to Norway?
It seems that Mod_Security doesn't like the Wordpress API being used.
I have another idea which I'm working on now...