Is it possible to restore from multiple snapshots at once?

Hi there!

I’m currently evaluating the use of restic for backup tasks on our Windows (IIS) server.

First, a bit of context:

We have a custom tool that performs backups of individual IIS websites and their corresponding databases in sequence to keep site downtime to a minimum. The tool in question stops each site, backs it up (copies the site files and its closed database files in a coherent state), then brings it back up and proceeds to the next site.

The copy itself is currently performed by robocopy but it is quite slow. I have run a couple of tests with restic and I’m seeing much better performance with it compared to a robocopy mirror operation (8 minutes for the initial backup of our worst-case site, then 2 for “incremental” backups, compared to ~ about 1h30m for the initial robocopy and worse than restic for the incremental backups).

So in essence, restic is working perfectly. However from what I’ve gathered, when it comes to restoring our files, having each site backed up in a separate snapshot makes restoring all of our sites at once more complicated.

I’ve read the restic restore documentation and tried various commands (using --path and dump, among others) but didn’t find a way to restore files from multiple snapshots at once.

Given multiple snapshots containing different sites:

ID         Paths
d98048c7   C:\Sites\SiteA
d49b19b8   C:\Sites\SiteB
7837f7b7   C:\Sites\SiteC

Would it be possible to restore all of C:\Sites in a single operation, without having to manually find the path of all websites and/or their corresponding snapshot IDs? Is this a valid way to use restic, or does storing individual “things” in separate snapshots not fit with how restic handles (for example) forgetting snapshots, restoration and such operations?

Keep in mind that our server runs Windows and using restic mount is not an option. And by curiosity, if restic mount was an option (for example on a Linux server), would that cover restoring the latest version of each path in a single operation?

Thanks in advance for any help!

There’s currently no support for restoring more than one snapshot at a time using restic restore, as you already guessed.

Mounting would have been an option, yes, because then you could have just copied the directories you wanted from multiple snapshots. But as you say, it’s currently not an option on Windows.

However, if you already have this setup, surely you already have some scripting done, and can simply write a script that e.g. parses the output of restic snapshots to grab a list of the latest snapshots covering all your sites, and restores those one after the other? :slight_smile:

However, if you already have this setup, surely you already have some scripting done, and can simply write a script that e.g. parses the output of restic snapshots to grab a list of the latest snapshots covering all your sites, and restores those one after the other?

I would have preferred not requiring installing and maintaining any tooling (besides restic) on the target machine, which is why I wanted to be 100% sure that restic didn’t support this before implementing something myself.

I think it would be a very nice feature for restic to have, though!

IMHO, from the “restoring things” point of view and regardless of how things are backed up (in a single step vs multiple steps), when the time comes to restore, I think I can generalize by saying people mostly think of files in terms of where they were (their path). Considering this, I think it makes sense that if you backup two or more things that have a common parent, being able to restore that parent in a single operation (regardless of which snapshot contain the latest data for each part of the path) is a pretty reasonable thing to expect restic to be able to do. A kind of “restore everything” operation, if you will.

Plus, in a time-critical emergency situation, the less scripts and custom tooling required the better, in my opinion.

Should I add a Github issue to request and track this? (I might eventually consider contributing – if that’s a feature that the restic project would consider including – but right now I do not have that luxury.)