Skip to content

Restoring

squirrel restore pulls a volume back from one of its destinations.

Terminal window
squirrel restore pictures --from nas
squirrel restore pictures --from nas --to /tmp/pictures-restore

It takes exactly one positional argument — the volume name.

FlagDefaultMeaning
--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 pathLocal target path.
--shallowoffSkip the checksum comparison on the way down from an rclone mirror. Every other destination’s bytes are re-hashed regardless.
--dry-runoffPreview what the restore would fetch without transferring.
--in-placeoffPermit restore against a non-empty live vol.Path; overwritten files are moved to .squirrel-restore-history/run-<id>/.

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.

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.

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.

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:

  1. Each present path is resolved to its content BLAKE3 in the index.
  2. The bytes are located per content: a per-hash object under objects/, or a member of a tar.zst pack under packs/ (pack_members carries its offset and length).
  3. Objects and packs are fetched through the same read path the push uses: squirrel’s own transport on a local disk and on sftp without crypt, with no rclone involved, and rclone (and its crypt overlay) elsewhere. Packs are fetched once — one download serves every requested member of that pack, never one fetch per file.
  4. 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, --shallow does not weaken an archive restore — the content check is intrinsic.)

squirrel restore still refuses kopia destinations — restore goes through the kopia CLI (kopia snapshot restore) instead.

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.