You have put up so much work and time into creating your great Ghost Blog. Naturally, you would want to make sure that the content of your Blog is protected. To ensure your Blog's content is safe, you need to backup your Ghost Blog continually.
Regularly backing up your data is an essential practice, and the frequency of your backups should depend on how often you add new posts or contents to your Blog. As a general rule, it is widely recommended that you should backup your Blog at least once a week.
Things you need to backup:
A Ghost Blog consists of files and a database. You need to backup both the files and the database which make up of your Ghost Blog. If you look at the root directory of your Ghost installation, you will see the files and folders organized as shown in the image below.
For most Ghost users, the files specific to the Blog are in the /content directory. The /content directory contains subdirectories for images, plugins, and themes. When you upload and add images in your Blog posts, these images are stored in the /content/images folder. The themes and plugins which you are using in your Ghost Blog are stored in the /content/themes and the /content/plugins directories respectively.
You also need to backup the file config.js in the root directory, since this file contains some configuration settings specific to your Ghost Blog.
Backing up the Ghost files
Essential things to backup in the Ghost's root directory:
If you don't want to backup individual directories and files, you can make a full backup of all the folders and files in the root directory. (Recommended)
To do that, stop Ghost if it is running, then make a copy of everything in the root directory of your Ghost installation. This way you don't have to backup individual directories and files, though it takes more space on your hard drive. In addition to this you should backup the database. Let's look at how to backup Ghost database.
Backing up the Ghost database
If you are using the default SQLite database for your Ghost Blog, you might want to backup the directory /content/data. But, before doing so, stop Ghost and make sure it is not running.
Backing up the database from the Ghost's interface:
You can backup the database whether you are using SQLite or MySQL after logging into Ghost from a web browser. To do so, log into Ghost, go to /ghost/debug, and click on the EXPORT button as shown below.
A .json file containing all the data of the database will be created and downloaded on your computer. This .json file is the database backup.
- Stop Ghost if it is running, then backup all the files and folders in the root directory of your Ghost installation.
- After logging into Ghost, go to /ghost/debug, and then click on the EXPORT button. This will create a backup of the database in JSON format.