Are server backups and snapshots good enough to backup an instance?

Our Mastodon instance is hosted in a server that provides regular backups and also the option to take snapshots any time.

I’m aware of the Mastodon Backups Guide but we wonder whether relying on these serves backups / snapshots is good enough?

For instance, we want to update our instance to the last version. Before that we want to backup the data, of course. Is it ok to just take a server snapshot, proceed with the update, and if anything goes wrong restore the snapshot?

I would shut it down and make sure the database is at rest.

How to implement such backup strategy to docker based instances?

The docker-compose file uses volumes so the data you need to retain is outside of the docker image. If you’re using Digital Ocean and want to backup manually you can just docker-compose stop from inside the mastodon directory, then shutdown now, and once your server finishes shutting down, take a snapshot in the DO console.

1 Like

I’m actually not using Digitalocean! Probably going to need a better strategy! Thanks for the word though!

@hugh did is what I did, thank you. The upgrade went well, and I didn’t need the snapshot after all.

1 Like

Hi all. I’ve started a simple project called incognitum which completely autonomously manages nightly encrypted offsite backups for Mastodon [Docker/Non-Docker] and has the following features:

  • One touch, three minute install

  • Set-it-and-forget-it backups will automatically run a backup of all your sites every night and email you in case of failure

  • Works with both Docker / Non-Docker installation types [not yet implemented / work in progress]

  • Stores backups both locally and remotely [on S3]

  • Encrypts all remote backups with a 42 character passphrase

  • Requires no configuration inside Mastodon and/or Docker, everything happens on the filesystem level completely unbeknownst to the application / containers themselves.

  • Performs a test restore before every S3 backup to ensure remote backup integrity and passphrase match

  • Allows you to restore your backup with one single command and a maximum of three minutes of your time even from a blank machine you’ve never set up before [not yet implemented / work in progress]

  • Perfectly restores every aspect of the Mastodon instance you’re hosting, from your database, to all of your files

  • Outputs clean and colorful logs and stores them automatically inside its own log directory

For now restores and Non-Docker backups are not yet implemented, but Docker backup works great! In fact, this code is what’s keeping our mastodon instance backed up every day on S3! If anyone running Debian/Ubuntu on their server is interested, please try it out and let me know how it’s working for you! It would also be great to add Non-Docker and restore functionality, which should be super easy.