New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should I create a pr for automated backups? #467
Comments
Hi, I realize it is not so simple to add systemd timers because
|
Separate code could be added for the timer. We have various cronjobs already, so using cronjobs may be a better approach, instead of introducing one more mechanism. Otherwise.. This code is pretty biased toward uploading stuff to S3, unencrypted. Where is the I wonder what we should do about backups, so that we can support more storage providers. Perhaps we should split the "backup creation" and "backup upload" parts. I'm thinking we should have some Not sure if there should only be one method to create the backup though. I'd imagine that some people would love an encrypted tarball containing everything, which could then be copied to any storage provider.. While others are file with just dumping the database periodically and Somewhat larger deployments likely can't afford to frequently make archives of everything (thousands of files in the Synapse media repository, etc.). |
@spantaleev I just did it as an example. To be honest, there are too many choices for backups
Distros already package awscli in their repos. You can run it in a container or install it. AWS CLI is designed to have little ideological policy. The command line interface should be stable forever. https://rpmfind.net/linux/rpm2html/search.php?query=aws-cli
Is it ok to create a cron job which execute a systemd service file? In the future, I kinda want to be able to email backup failures. |
It'd still be better if we refrain from installing I think it's nice how the playbook currently installs some bare minimum set of packages (see the It'd probably be nice if we can support access key/secret authentication to S3, for people who don't host their server on AWS. And then, maybe would even like configuring the endpoint, so they can point it to an S3-like alternative, like Digital Ocean Spaces. This should be fairly easy though - just another configurable switch. |
Hi, How do you envision rsync? I posted a sample documentation for scrutiny
Setting up Matrix Synapse backups (optional)This playbook installs a weekly cron backup. Variable Table
Method 1: Rsync?? Method 2: S3 Compatible object storeSetup: S3 compatible buckets S3 compatible services https://en.wikipedia.org/wiki/Amazon_S3#S3_API_and_competing_servicesPreparationSelect a S3 compatible provider. Backup-acl.json
Restore-acl.json
Deploy Matrix S3 BackupUsing AWS IAM RoleSet Using AWS IAM UserSet S3 Compatible ServicesSet |
In the spirit of Synapse being selfhosted, I would prefer to see rsync instead of S3. I also think that your back up is only for the database right? It would be good to include an option to backing up files (i.e. images) as well. |
It would indeed be nice to not need an S3 API endpoint. E.g. rsync, restic, borgbackup |
I apologize for not keeping my commits up to date because I have been busy with other things. @ptman @beardedlinuxgeek I avoided rsync, restic, and borgbackup because everyone has their own backup workflow. Would you kindly document your workflow and your proposed Ansible vars for everyone's benefit? I want to avoid creating something nobody wants because I imagined the wrong user. |
I think there are two parts:
For 1, I would expect one to create timestamped dumps at a given interval (1d, 1h, whatever) and clean up old ones (7d, 30d, 90d, 1y, just keep the latest one (since you mostly care about dumping and then transfer them somewhere else)). And yes, this should be a PR, not code in comments. |
Have all the issues about a backup role been abandoned? I've seen two issues created by @hungrymonkey but nothing seems to have been merged into main branch. What is the proposed best way of doing it? Is a backup of the Postgres database enough to be able to reinstall matrix from scratch with the playbook, import the database, and be able to access the service with all the discussions again (albeit without the media files, but I don't care about those) ? |
@Hexalyse The problem is that there isn't a best way to do backups. Unfortunately, all administrators have a personal preference and this playbook needs to be flexible enough to allow different workflows but also allow the maintainer feel comfortable to be included. For this playbook, all you need to backup the db and figure out a method to restore it. The maintainer has added a hard dependency on Postgres so I assume it will be supported in the future. |
@hungrymonkey Sure... backups processes are opinionated. Wouldn't it be better to offer one by default, that users can use... or just leave disabled and do their own thing? Especially when you consider how many people don't set up backups, until the day something happens and ... |
The only tool that can remotely can be default is a simple rsync but you still need a separate cheap reliable storage. |
I have been reviewing the s3 counterpart of the container used in matrix-postgres-backup. The s3 container does not seem to be maintained anymore and the variables leaks go-cron variables. I wonder if I should leak it too. |
Related to: - spantaleev#1727 - spantaleev#1754 - spantaleev#1755 - spantaleev#467
Borg backup support exists? |
I suppose that Borgbackup support is good enough and we can close this! |
I saw the deficiencies section and I wonder if I should try to contribute back.
matrix-synapse-backup.service
matrix-synapse-backup.timer
backup-acl.json
restore-acl.json
The text was updated successfully, but these errors were encountered: