Back up your Ghost blog with RSS (with Images 🌉)

Hi :raised_hands: everyone

I am really enjoying the Ghost :ghost: blogging experience. But there were a few problems – and one of them was the fact that there wasn’t a simple way to back up all of the posts in “human-readable form.” Yes, Ghost does provide a backup feature on the admin page, but 1) it is not human-readable, and 2) it does not back up images. Even if you access the ghost server to restore the pictures, the pictures are organized by the uploaded date, so it was a hassle to figure out which photo belonged to which post.

So, I developed a short python script that would back up the entire blog posts with RSS. It downloads all of the images and replaces the embedded photos so that it would serve as a static archive of any Ghost blog. It works with Ghost, Wordpress, Jekyll-based GitHub Pages, Gatsby-based GitHub Pages, Medium, as I checked.

This project does not intend to replace Ghost’s back up feature. It will work alongside it. Use Ghost’s default backup system to back up all of the blog’s data, and use this to back up images and to create a readable archive.

Note: Ghost’s RSS feed only includes 15 posts. Therefore, if you use the default settings for Ghost, this backup script will only include the most recent 15 posts.

Any suggestions or ideas are welcomed :smile:

GitHub link below :point_down:

1 Like

Cool idea. You could also try the Content API, which includes all of the posts - and more meta data that is not availalbe in RSS :slight_smile:

1 Like

I’ve got an example of using the Content API in a similar fashion. It’s a Netlify Build plugin that retrieves all posts and pages, generates them as .md files with their HTML content and downloads all the locally uploaded images into an assets directory:

This uses the JavaScript Client, but I’m guessing python would be a bit speedier with the Content API :sweat_smile: