Restoring
squirrel restore pulls a volume back from one of its destinations.
squirrel restore pictures --from nassquirrel restore pictures --from nas --to /tmp/pictures-restoreIt takes exactly one positional argument — the volume name.
| Flag | Default | Meaning |
|---|---|---|
--from <name> | — | Destination name to pull from, or peer node name to filter by content origin (names are unique across both kinds). |
--to <path> | volume’s declared path | Local target path. |
--shallow | off | Skip the checksum comparison on the way down from an rclone mirror. Every other destination’s bytes are re-hashed regardless. |
--dry-run | off | Preview what the restore would fetch without transferring. |
--in-place | off | Permit restore against a non-empty live vol.Path; overwritten files are moved to .squirrel-restore-history/run-<id>/. |
Verification on the way down
Section titled “Verification on the way down”A native mirror restore and a content-addressed or packed
restore hash every byte to BLAKE3 as it arrives and refuse what does not match
(see below). A restore from an rclone mirror compares each file with its copy by
checksum as it arrives, the same comparison sync
uses on the way up; pass --shallow to skip it.
Every restored file lands through a temporary file beside its path, which is flushed and then renamed over it, so a restore that stops halfway never leaves a truncated file behind.
Restoring in place
Section titled “Restoring in place”By default restore refuses to write into a non-empty live volume path, to avoid
clobbering current data. --in-place permits it — and any file it would
overwrite is first moved to .squirrel-restore-history/run-<id>/, mirroring the
append-only .squirrel-history behavior on the sync
side. Nothing is destroyed.
Native mirrors
Section titled “Native mirrors”A native mirror — local,
or sftp without crypt — is read through squirrel’s own transport; no rclone is
involved.
- With an index that holds present files for the volume, each present path is fetched by its path and its bytes are checked against the index’s BLAKE3 as they stream; a file whose bytes differ is refused, not written. A path that already holds its indexed bytes is left alone and counted as already correct.
- Without one — a fresh machine, before or instead of
squirrel recover— restore walks the mirrored tree, leaving out.squirrel-history/,.squirrel-index/,.squirrel-staging/and the marker. The mirror’s receipts name the content each path last held, so every file a receipt names is checked against it and refused if it differs. A file no receipt names (one squirrel did not write) is restored unchecked, and the run’s warnings count them. The._files macOS keeps beside each file on an exFAT or FAT disk hold that file’s extended attributes; restore leaves them out and counts them in one warning.
Content-addressed and packed destinations
Section titled “Content-addressed and packed destinations”squirrel restore handles the
content-addressed and
packed layouts too — they have no mirrored tree to
copy, so restore works from the local index instead:
- Each present path is resolved to its content BLAKE3 in the index.
- The bytes are located per content: a per-hash object under
objects/, or a member of atar.zstpack underpacks/(pack_memberscarries its offset and length). - Objects and packs are fetched through the same read path the push uses:
squirrel’s own transport on a
localdisk and onsftpwithout crypt, with no rclone involved, and rclone (and itscryptoverlay) elsewhere. Packs are fetched once — one download serves every requested member of that pack, never one fetch per file. - Every fetched object and extracted pack member is re-hashed to BLAKE3 and
compared before it is written, so a misplaced or corrupted byte is refused
rather than restored. (Because of this,
--shallowdoes not weaken an archive restore — the content check is intrinsic.)
Kopia destinations
Section titled “Kopia destinations”squirrel restore still refuses kopia destinations —
restore goes through the kopia CLI (kopia snapshot restore) instead.
Restoring the index too
Section titled “Restoring the index too”For a full disaster-recovery scenario, remember that squirrel rides an
index snapshot along to its
destinations under .squirrel-index/. A restore from a destination yields the
data and the index that explains it — use squirrel db restore
to swap that snapshot in as the live index.