This might be a dumb question, but in order to back up a Mastodon instance, if one were simply to rsync the /home/mastodon/ folder, would it then work to simply restore that folder in the case of a failure?
-
This might be a dumb question, but in order to back up a Mastodon instance, if one were simply to rsync the /home/mastodon/ folder, would it then work to simply restore that folder in the case of a failure?
-
This might be a dumb question, but in order to back up a Mastodon instance, if one were simply to rsync the /home/mastodon/ folder, would it then work to simply restore that folder in the case of a failure?
depends - if you restore something that file structure that broke the instance in the first place, then you'll be restoring the break as well.
syncthing does versioned backups, and is bascially rsync on steroids, so you might be able to mitigate the above with a more selective restore in the event of calamity.
-
depends - if you restore something that file structure that broke the instance in the first place, then you'll be restoring the break as well.
syncthing does versioned backups, and is bascially rsync on steroids, so you might be able to mitigate the above with a more selective restore in the event of calamity.
@maya_b
Oooh. Good point.Right now I keep versioned snapshots of the VM (5 days worth) as well as a complete daily copy of the VDI.
-
This might be a dumb question, but in order to back up a Mastodon instance, if one were simply to rsync the /home/mastodon/ folder, would it then work to simply restore that folder in the case of a failure?
@fname You usually don't need to backup that directory. It should be all reproducible by the install instructions. What you want to backup: Your database, your uploads, and your config. There isn't really more to do. (Redis/Valkey exists but can be reproduced.)
Backing up your server - Mastodon documentation
Setting up regular backups (optional, but not really)
(docs.joinmastodon.org)
It's not uncommon that your uploads are on S3 and your database uses a different directory, therefore the only thing you backup, when backing up /home/mastodon is your config.
-
@fname You usually don't need to backup that directory. It should be all reproducible by the install instructions. What you want to backup: Your database, your uploads, and your config. There isn't really more to do. (Redis/Valkey exists but can be reproduced.)
Backing up your server - Mastodon documentation
Setting up regular backups (optional, but not really)
(docs.joinmastodon.org)
It's not uncommon that your uploads are on S3 and your database uses a different directory, therefore the only thing you backup, when backing up /home/mastodon is your config.
@sheogorath
Ok, but wouldn’t it take just as much or more time/effort to go through a complete reinstall, and the restore the database than just to restore the whole folder intact?
-
This might be a dumb question, but in order to back up a Mastodon instance, if one were simply to rsync the /home/mastodon/ folder, would it then work to simply restore that folder in the case of a failure?
@fname
I don't think so. You would have to backup the database, too. And Mastodon needs some required software (nginx...), you would have to install. -
@sheogorath
Ok, but wouldn’t it take just as much or more time/effort to go through a complete reinstall, and the restore the database than just to restore the whole folder intact?
@fname @sheogorath As with all things, "it depends". I tend to agree with your VM backup approach - Postgres is transaction logged, so if your VM level backups invoke a helper that halts guest operating system I/O while the snapshot is being taken (eg. qemu-guest-agent or whatever), you have a complete DB file and a complete transaction log at the time of backup. That means restoring the VM is going to restore a consistent point in time DB as well.
-
This might be a dumb question, but in order to back up a Mastodon instance, if one were simply to rsync the /home/mastodon/ folder, would it then work to simply restore that folder in the case of a failure?
@fname Assuming you have no S3 storage and are using local, then you need to backup public/system, along with the postgresql database. And you need to backup the .env.production.
-
R relay@relay.mycrowd.ca shared this topic