Restore dry-run

I am trying to plug restic in a custom tape backend and it seems pretty much OK thanks the the properties of the restic backup objects (very nice specification job!).
Backups are going well but before I can restore anything I need to get the lists of pack files I need to recall from tape.
I looked in the structures and getting the index and resolving the snapshot file tree to get the packs is possible…
I was wondering if there could be a restore dry-run option to list the needed pack files so that I could retrieve these from tape before performing the final restore.

Thanks for your help with this.

This would also be a useful feature for anyone wanting to use cold cloud storage tiers (Glacier, GDA, etc.). The alternative is a whole-repository restore to hot storage which is usually quite expensive.

Internally, restore calculates set of pack files it needs to download upfront. It should be fairly straightforward to dump the set in some sort of json. This is the place in code where packs map contains what you need.

Exactly what I was looking for, many thanks!

restoring <Snapshot 5c84d118 of [/root] at 2020-06-16 17:25:24.299624035 +0200  CEST by root@devsystem> to /tmp/testice
Downloading pack: db45753587c5e0966771db87e269cf837bcab02519b3dab292cb89be3ff0336b
Downloading pack: bfa44aa86e572dadb575f3cc1ccb264992b7fbfbabc29863e635f6da554a4b8c   
Downloading pack: 541e5a419bc84c0cbcc755f2d8fd7618f343012e1b704564b2f6d894f55291d2
Downloading pack: 7d001c1f37a918c5b9063e1f92118af5bb8de24869abf6ee70d05b32fe8a045e

Many thanks!

This is exactly what cold storage need and this is what I am testing…

Basically everything goes both hot and cold so that the full restic repository can be restored from cold storage.
Data folder can be cold only after 24 hours or something like that.

A restic restore --json --dry-run should dump the list of required pack files in json for the restore set.

This is then submitted to the cold backend and brought back in the hot storage. Restore can now take place.

I have created the feature request 2796 as I think this would be useful to others.

I tried to explain my approach: what should be hot or cold in a restic repository for cold backup/restore to work.

Do not hesitate to complement this feature request if you have any interest in this.

1 Like