autorestic icon indicating copy to clipboard operation
autorestic copied to clipboard

Backup databases

Open tobiasBora opened this issue 1 year ago • 3 comments

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.

tobiasBora avatar Sep 11 '24 11:09 tobiasBora

How does recovery work for these things? should autorestic also recover the dumped files and blast them back at the running dbms?

guest20 avatar Sep 11 '24 14:09 guest20

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.

tobiasBora avatar Sep 11 '24 14:09 tobiasBora

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

kytta avatar Mar 17 '25 08:03 kytta