For proper full backups, I always recommend against the JSON exports.
They do not include email analytics or comments, for example.
If you really want to spin up a Ghost site 1:1 again, there’s only one way:
- Backup your MySQL database
- Backup your
/contentfolder
The steps to get backups are the same in Ghost 6 (copying from my blog, but since that is mainly about migrations, I don’t think a link will do any good here):
To back up your database, you can do the following:
# Create a directory for your backups
mkdir -p ~/ghost-migration
# First, list your containers to find the MySQL one
docker ps
# Then create the backup directly from the container
docker exec MYSQL_CONTAINER_NAME mysqldump -u root -p ghost > ~/ghost-migration/ghost_backup.sql
For the content folder in a Docker setup, you’ll need to locate and copy from your mounted volume. Here’s the safest way to do this:
# First, find your Ghost volume
docker volume ls
# Inspect the volume to find its location
docker volume inspect ghost_ghost_data
# Create a temporary container to copy the content
docker run --rm \
-v ghost_ghost_data:/ghost_content \
-v ~/ghost-migration:/backup \
alpine \
tar czf /backup/ghost_content_backup.tar.gz -C /ghost_content .
Now both your backups are in the ~/ghost-migration folder on your Docker host. You can download them to your local computer using rsync:
rsync -av your_username@your_server:~/ghost-migration/ ./ghost-migration/