#123 Support borg extract and mount for restoration use cases

Open
opened 1 month ago by witten · 2 comments
witten commented 1 month ago

From a borgmatic user, reported via email:

I use borgmatic/borgbackup to manage backups for various IT workflows. Borgmatic has been a great help at hiding Borg’s rather messy command line for day to day operations.

However in trying to transition my workflow to Ansible I’ve noticed that the lack of a feature complicates what should be a trivial task. Namely the lack of either “borg extract” or “borg mount” equivalents. This is extremely useful for restoring stateful applications (GitLab, EMail, Databases etc) from a backup to a new server. This is a crucial component for any DevOps/IT to test systematically as an untested backup might as well not exist.

It would be good to see the “restore” functionality added to Borgmatic. While I can get it to work in Ansible, (running the raw borg commands) it means I end up duplicating information in my Playbook and Borgmatic config. The fragility of this setup has already bit me in the rear.

Sample usage
sudo borgmatic --extract /path # Extracts the latest archive
sudo borgmatic --extract /path XXXX # Extracts archive with matching hash

Give it some thought, but for me at least its the last thing that prevents borgmatic being the perfect little tool for the common use cases of Borg.

From a borgmatic user, reported via email: > I use borgmatic/borgbackup to manage backups for various IT workflows. > Borgmatic has been a great help at hiding Borg's rather messy command > line for day to day operations. > > However in trying to transition my workflow to Ansible I've noticed > that the lack of a feature complicates what should be a trivial task. > Namely the lack of either "borg extract" or "borg mount" equivalents. > This is extremely useful for restoring stateful applications (GitLab, > EMail, Databases etc) from a backup to a new server. This is a crucial > component for any DevOps/IT to test systematically as an untested > backup might as well not exist. > > It would be good to see the "restore" functionality added to > Borgmatic. While I can get it to work in Ansible, (running the raw > borg commands) it means I end up duplicating information in my > Playbook and Borgmatic config. The fragility of this setup has already > bit me in the rear. > > ##### Sample usage > > ```bash > sudo borgmatic --extract /path # Extracts the latest archive > sudo borgmatic --extract /path XXXX # Extracts archive with matching hash > ``` > > Give it some thought, but for me at least its the last thing that > prevents borgmatic being the perfect little tool for the common use > cases of Borg.
witten commented 1 month ago
Owner

Thanks for the feature idea. That sounds like a very reasonable feature for the use case you mention. I recently added support for “borg init” to borgmatic, so I could see doing something similar for borg extract and mount.

Also note that there is already an “extract” consistency check implemented in borgmatic, which basically does a test extraction of the most recent archive so as to validate your backups. Not as flexible as what you’re talking about, but it might be a start.

Thanks for the feature idea. That sounds like a very reasonable feature for the use case you mention. I recently added support for "borg init" to borgmatic, so I could see doing something similar for borg extract and mount. Also note that there is already an "extract" consistency check implemented in borgmatic, which basically does a test extraction of the most recent archive so as to validate your backups. Not as flexible as what you're talking about, but it might be a start.
varac commented 2 weeks ago

Just needed to restore a backup, and found that borgmatic doesn’t support this by now. Please add it soon, restore is actually really neeed :)

Just needed to restore a backup, and found that borgmatic doesn't support this by now. Please add it soon, restore is actually really neeed :)
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
Cancel
Save
There is no content yet.