autorestic
autorestic copied to clipboard
Backup databases
Is your feature request related to a problem? Please describe.
It is common to backup databases, but saving the folder of the database itself may lead to inconsistencies, hence it is better to backup a dump of the database.
Describe the solution you'd like
Other tools like borgmatic provide options to backup directly a database https://torsion.org/borgmatic/docs/how-to/backup-your-databases/ and it would be great to have this in autorestic as well:
postgresql_databases:
- name: all
mongodb_databases:
- name: messages
hostname: database5.example.org
port: 27018
username: dbuser
password: trustsome1
authentication_database: mongousers
options: "--ssl"
Some people also suggested to allow backing up from stdin, which I also find it very interesting: https://github.com/cupcakearmy/autorestic/issues/8 but in any case it would be nice to allow a more high-level support for databases.
How does recovery work for these things? should autorestic also recover the dumped files and blast them back at the running dbms?
I guess it makes sense yes. Some users might also prefer to just read it from stdin and do something with it, so I guess it would be nice to provide both an automatic restore and a more manual one.
I myself am not a fan of creating a specific setting for every database out there; I think autorestic should be minimalistic. What should be added, though, is support for stdin. It was proposed in #8, but turned down. I think it's time to revisit it: #434