I personally used this project to move my blog from Blogger to Ghost. I tried using a number of existing migration tools, but none did everything I wanted and all were written in a language I don't know well enough to quickly fix their shortcomings.
- Use the blogger export feature and don't rely on the public atom/rss feeds.
- Remap blogger tags to ghost tags (incl redirects)
- Remap multiple blogger tags to a single ghost tag
- Delete redundant tags
- Auto-order tags based on priority
- Remap old urls to new ones (incl redirects)
- Convert HTML to Markdown
- Download all images from blogger (and other sources)
- Detect missing/broken images
- Detect malformed links
- Retain the old RSS feed urls
- Retain the Google+ comments
- Fixes internal links
- Converts
<pre>tags to code blocks - Generate easy to import zip file
This project relies on
- ManyConsole to provide rudimentary help information
- Newtonsoft.Json to build the mapping and export files
- ReverseMarkdown to convert HTML to Markdown
-
Generate all the mapping files
- Run
blogger2ghost mapping -i bloggerbackup.xml -o .\migration --all- Include
--include-draftsto migrate draft posts as well. - Include
--fromand--toto change the urls of each post using Regex. - Include
--forceto overwrite any existing mapping file. - Replace
--allwith--tags,--urlsor--authorsto (re)generate individual files.
- Include
- Run
blogger2ghost images -i bloggerbackup.xml -o .\migration- Include
--include-draftsto migrate draft posts as well. - Include
--forceto overwrite any existing mapping file.
- Include
- Run
-
Create the required users in Ghost and set their email and slug.
-
Manually edit the
authors.jsonto map your Google+ account to your Ghost email and slug. -
Manually edit the
tags.jsonto map your blogger tags to ghost tags.- Map multiple tags by adding them to the blogger tags array.
- If the blogger tag is different than the ghost slug also add the blogger tag to the aliases array.
- Create parent/child tags by nesting child tags in the child_tags array.
-
Manually edit the
urls.jsonto update the slug (ToUrl) to use on Ghost (don't change the blogger urls). -
Manually edit the
images.jsonto update image file names or external locations- If you want to rename your images, change the file name in the
.\migration\imagesfolder and update theimages.jsonaccordingly. - If images failed to download optionally download alternate images yourself and update the
.\migration\imagesaccordingly.
- If you want to rename your images, change the file name in the
-
Optionally resize your images using your favorite image editor.
-
Upload your custom theme containing the
custom-blogger.hbstemplate. -
At this point you're ready to generate the import file for Ghost.
blogger2ghost convert -i bloggerbackup.xml -o .\migrationOptionally add:
- Include
--forceto overwrite any existing export files. - Include
--template bloggerto assign thecustom-blogger.hbstemplate to each post - Include
--zipto zip up the.\migration\ghost.jsonand all images in.\migration\imagesfor import. - Include
--markdownto convert your blogger HTML to markdown. - Include
--include-draftsto migrate draft posts as well. - Include
--redirect-permanentto generate 301 type redirects.
- Include
-
Upload the final
ghost.jsonorghost.zipto your ghost blog. -
Upload the final
redirects.jsonto your ghost blog.
It took me a few attempts to get everything right. You can use the "Delete all content" option in the Ghost admin panel to start over.
To include Google+ comments from your old blog, include:
<script src="https://apis.google.com/js/plusone.js"></script>
<div id="comments"></div>
<script>
if (bloggerUrl){
gapi.comments.render('comments', {
href: bloggerUrl,
width: '624',
first_party_property: 'BLOGGER',
view_type: 'FILTERED_POSTMOD'
});
}
</script>
in your custom-blogger.hbs in the comment section. The bloggerUrl variable will automatically be added in the post's code injection header section.