Restore into an empty folder.

A restore extracts a snapshot into a scratch directory. The live site stays where it is. Run the check once so you know the archive comes back.

Check a restore, or just extract

Both commands need the site's id and its exact root. test_restore extracts the snapshot, compares the files to the manifest, and records that the check passed. restore_backup extracts the snapshot into the folder you name.

./bin/backupbinder test_restore --id SITE --root /path/to/site
./bin/backupbinder restore_backup --id SITE --root /path/to/site --scratch /tmp/empty-scratch

Omit --scratch and the program creates a new empty directory under var/scratch/<site id>/. If you pass --scratch, that path has to be a directory with nothing in it. A path that does not exist yet is created. A path that already has files is refused. A path that exists and is not a directory is refused.

Without --detach, the command waits until the restore finishes. With --detach, poll inspect_site for the restore status.

Paths that are refused

The scratch path cannot be the live site, a directory inside it, or a parent directory that contains it. It cannot be the restic repository either. Those refusals are there so a restore cannot overwrite the site you are backing up, or the archive itself.

A path the program refuses is not used. If the files come back and do not match the manifest, the scratch directory is left in place and the live site is left unwritten. The error message names what failed.

Restore confidence

Until a scratch restore has passed, confidence is never. After test_restore succeeds, the site records the time that check passed. The site page shows it, next to the last run.

The check compares restored files with the manifest inventory. When the backup included a database dump, the check looks at that dump too. Confidence is the time of that passed check. It is not a separate health score.