#123 Support borg extract and mount for restoration use cases

クローズ
witten1年前に作成 · 9件のコメント
witten1年前 にコメント

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.
witten1年前 にコメント
オーナー

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.
varac1年前 にコメント

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 :)
witten がコミットでこの課題を参照 1年前
witten1年前 にコメント
オーナー

Extract has been released as part of borgmatic 1.2.16. Mount is still to-do, so I’ll leave this ticket open.

Docs here: https://torsion.org/borgmatic/docs/how-to/restore-a-backup/

Enjoy!

Extract has been released as part of borgmatic 1.2.16. Mount is still to-do, so I'll leave this ticket open. Docs here: https://torsion.org/borgmatic/docs/how-to/restore-a-backup/ Enjoy!
varac1年前 にコメント

Awesome !!!

Awesome !!!
varac1年前 にコメント

Work great, one thing missing is the ability to list the files of an archive, which would be done in borg list ${BORG_REPO}::${BORG_SET} and could be implemented with borgmatic --list --archive ${BORG_SET}. Right now it complains about it:

borgmatic --list --archive varac-2019-02-18T12:17:04.114434
The --archive option can only be used with the --extract option

Work great, one thing missing is the ability to list the files of an archive, which would be done in `borg list ${BORG_REPO}::${BORG_SET}` and could be implemented with `borgmatic --list --archive ${BORG_SET}`. Right now it complains about it: ``` borgmatic --list --archive varac-2019-02-18T12:17:04.114434 The --archive option can only be used with the --extract option ```
varac1年前 にコメント

Also, an equivalent of borg info ${BORG_REPO}::${BORG_SET} would be great, like borgmatic --info --archive ${BORG_SET}. That would complete a convenient restore functionality.

Also, an equivalent of `borg info ${BORG_REPO}::${BORG_SET}` would be great, like `borgmatic --info --archive ${BORG_SET}`. That would complete a convenient restore functionality.
varac1年前 にコメント

I added #140 and #141 for the missing pieces.

I added #140 and #141 for the missing pieces.
witten1年前 にコメント
オーナー

Good ideas. Thanks for filing. I’ll follow up on those tickets.

Good ideas. Thanks for filing. I'll follow up on those tickets.
witten7ヶ月前 にコメント
オーナー

borgmatic mount has finally been implemented! Released as part of version 1.4.15. There’s also a matching borgmatic umount action. Documentation is here: https://torsion.org/borgmatic/docs/how-to/extract-a-backup/#mount-a-filesystem

`borgmatic mount` has finally been implemented! Released as part of version 1.4.15. There's also a matching `borgmatic umount` action. Documentation is here: https://torsion.org/borgmatic/docs/how-to/extract-a-backup/#mount-a-filesystem
witten が課題をクローズ 7ヶ月前
サインインしてこの会話に参加。
マイルストーンなし
担当者なし
2 人の参加者
通知
期日

期日は未設定です。

依存関係

この課題に依存関係はありません。

読み込み中…
まだ内容がありません