Why are "database hook" and "one_file_system" are linked together? #527

Closed
opened 7 months ago by qupfer · 3 comments

Hi,

and yes, if I follow the "RTFM" approach, I would have saved a lot of time :-)

I moved a service (mailcow) from one host to an other and after that, my borgmatic backups are nearly empty (empty folder) but success.

I was clever enough to think thas related to the btrfs filesystem (old host was ext4).
So I looked and found the "one_file_system" option. But it did not change anything. Folders still empty in the borg repo.
After reading all lines of the manual, I saw its always "true" if a database hook is used. Bingo!
Changing that (disasble database hook), it looks like all is copied and the folders contain the data again.

But why is this linked together? And is there an option to have an database dump inside the borg repo and all data - without having all in the same btrfs subvolume?

And yes, I also think there could be some discussion if a btrfs subvolume should be treated as an other filesystem or not scnr

Thanks
a still happy borg(matic) user

Hi, and yes, if I follow the "RTFM" approach, I would have saved a lot of time :-) I moved a service (mailcow) from one host to an other and after that, my borgmatic backups are nearly empty (empty folder) but success. I was clever enough to think thas related to the btrfs filesystem (old host was ext4). So I looked and found the "one_file_system" option. But it did not change anything. Folders still empty in the borg repo. After reading all lines of the manual, I saw its always "true" if a database hook is used. Bingo! Changing that (disasble database hook), it looks like all is copied and the folders contain the data again. But why is this linked together? And is there an option to have an database dump inside the borg repo and all data - without having all in the same btrfs subvolume? And yes, I also think there could be some discussion if a btrfs subvolume should be treated as an other filesystem or not *scnr* Thanks a still happy borg(matic) user
Owner

Yikes, nearly empty backups are not good!

But why is this linked together?

You can find the sordid history of that in the comments on #315! But the short of it is that because borgmatic sets read_special when database hooks are enabled (to support streaming databases directly to Borg), it also needs to set one_file_system to prevent hanging in many common use cases like backing up /.

And is there an option to have an database dump inside the borg repo and all data - without having all in the same btrfs subvolume?

Not all in one configuration file, currently. However, if you put your database dumps in one configuration file and your btrfs backups in another, then I believe that would allow borgmatic to run Borg once with one_file_system (for the database backup) and once without (for the btrfs backup). The downside is you'd end up with a separate archive for each.

(Note that as of borgmatic 1.6.0, you can share common settings between the two configuration files pretty easily.)

Let me know your thoughts!

Yikes, nearly empty backups are not good! > But why is this linked together? You can find the sordid history of that in the comments on #315! But the short of it is that because borgmatic sets `read_special` when database hooks are enabled (to support streaming databases directly to Borg), it also needs to set `one_file_system` to prevent hanging in many common use cases like backing up `/`. > And is there an option to have an database dump inside the borg repo and all data - without having all in the same btrfs subvolume? Not all in one configuration file, currently. However, if you put your database dumps in one configuration file and your btrfs backups in another, then I *believe* that would allow borgmatic to run Borg once with `one_file_system` (for the database backup) and once without (for the btrfs backup). The downside is you'd end up with a separate archive for each. (Note that as of borgmatic 1.6.0, you can [share common settings](https://torsion.org/borgmatic/docs/how-to/make-per-application-backups/#include-merging) between the two configuration files pretty easily.) Let me know your thoughts!
witten added the
question / support
label 7 months ago
Poster

Thanks for your clear answer. That helps to understand.
I solved it for me to make the database dump "outside" borgmatic and put it in the filesystem, I use this also too switch to mariabackup instead mysqldump.
But will try the "two-config-solution" sometimes too.

Thanks for your clear answer. That helps to understand. I solved it for me to make the database dump "outside" borgmatic and put it in the filesystem, I use this also too switch to mariabackup instead mysqldump. But will try the "two-config-solution" sometimes too.
Owner

Sounds good! Glad to hear you have a work-around.

Sounds good! Glad to hear you have a work-around.
witten closed this issue 7 months ago
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#527
Loading…
There is no content yet.