Save all databases in seperate files #393

Closed
opened 2021-02-23 17:58:58 +00:00 by eipi-1 · 3 comments

What I'm trying to do and why

I would like to save databases using the name: all feature in different files. This would allow deletion (and extraction) of seperate databases.

I need to backup a mariadb server with around 200 databases and growing. I currently use borgmatic to backup all databases using the name: all feature. Borgmatic creates a single file .borgmatic/mysql_databases/db_server/all. I would like to be able to delete a single database from all archives (using borg recreate). Therefor I need all databases in seperate paths.

Other notes / implementation ideas

In order to keep backwards compatibility this could by implemented using a config flag like seperate_files: true or by using a different keyword name: all_seperated.

Environment

borgmatic version: 1.5.10

borgmatic installation method: Docker

Borg version: 1.1.3

Python version: 3.6.8

Database version (if applicable): mariadb 10.5.9

#### What I'm trying to do and why I would like to save databases using the `name: all` feature in different files. This would allow deletion (and extraction) of seperate databases. I need to backup a mariadb server with around 200 databases and growing. I currently use borgmatic to backup all databases using the `name: all` feature. Borgmatic creates a single file `.borgmatic/mysql_databases/db_server/all`. I would like to be able to delete a single database from all archives (using [borg recreate](https://borgbackup.readthedocs.io/en/stable/usage/recreate.html)). Therefor I need all databases in seperate paths. #### Other notes / implementation ideas In order to keep backwards compatibility this could by implemented using a config flag like `seperate_files: true` or by using a different keyword `name: all_seperated`. #### Environment **borgmatic version:** 1.5.10 **borgmatic installation method:** [Docker](https://hub.docker.com/r/monachus/borgmatic) **Borg version:** 1.1.3 **Python version:** 3.6.8 **Database version (if applicable):** mariadb 10.5.9

Seconded. I'd be willing to contribute a patch if we find an agreement on what the configuration should look like. I like introducing name: all_separated.

Seconded. I'd be willing to contribute a patch if we find an agreement on what the configuration should look like. I like introducing `name: all_separated`.

I have exactly the same use case with PostgreSQL. For various historical reasons, my database sizes vary a lot as well, some store files with multiple GiB each, while others are somewhat small. All manual processes would benefit a lot if I was able to access only those files for individual databases of interest.

Additionally, it might even improve compression and de-duplication to "group" only that data which belongs together, regardless of any other. Would be great if pg_dumpall simply had such a feature already, so that BorgMatic would only need to forward some arguments, but that doesn't seem to be the case. Other people with similar use cases seem to simply split created dump files afterwards. While that might be an idea for a hook in BorgMatic, I gues it's difficult to implement with the streaming approach of database dumps, temporarily consumes more space etc.

I have exactly the same use case with PostgreSQL. For various historical reasons, my database sizes vary a lot as well, some store files with multiple GiB each, while others are somewhat small. All manual processes would benefit a lot if I was able to access only those files for individual databases of interest. Additionally, it might even improve compression and de-duplication to "group" only that data which belongs together, regardless of any other. Would be great if `pg_dumpall` simply had such a feature already, so that BorgMatic would only need to forward some arguments, [but that doesn't seem to be the case](https://www.postgresql.org/message-id/1225386069.20210715182946%40am-soft.de). Other people with similar use cases seem to simply [split created dump files afterwards](https://github.com/kruckenb/split_postgres_dump/blob/master/split-pg-dump.pl). While that might be an idea for a hook in BorgMatic, I gues it's difficult to implement with the streaming approach of database dumps, temporarily consumes more space etc.
Owner

This has been implemented in borgmatic 1.7.6! To enable it, add a format option to your "all" database configuration. Then borgmatic will create individual dump files per database. See the documentation for more information: https://torsion.org/borgmatic/docs/how-to/backup-your-databases/#all-databases

This has been implemented in borgmatic 1.7.6! To enable it, add a `format` option to your "all" database configuration. Then borgmatic will create individual dump files per database. See the documentation for more information: https://torsion.org/borgmatic/docs/how-to/backup-your-databases/#all-databases
Sign in to join this conversation.
No Milestone
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#393
No description provided.