snapdir sync

Copy a snapshot (its manifest + objects) directly between two stores, streaming through memory — no local staging.

sync transfers a snapshot from one store to another without writing it to the local cache. This is the efficient way to replicate snapshots between, say, two S3 buckets or from S3 to local. See the Syncing guide.

Usage

snapdir sync [OPTIONS] --from <STORE> --to <STORE>

Options

sync requires both --from and --to:

Option Description
--from <STORE> Source store URI: protocol://location/path.
--to <STORE> Destination store URI: protocol://location/path.
--from-objects <URI> Explicit source object pool URI for split source stores; objects are read from here while manifests come from --from.
--to-objects <URI> Explicit destination object pool URI for split destination stores; objects are written here while manifests go to --to.

It also accepts the transfer option family: --id, --store, --objects-store, --catalog, --cache-dir, -j/--jobs, --limit-rate, --adaptive[=<FRACTION>], --max-jobs, retry/request caps, --force, --keep, and --dryrun, plus universal output-control options. --from can also fall back to SNAPDIR_STORE. --linked may appear in shared CLI help, but sync does not materialize a directory, so it does not create symlinks.

Distinct from the global --objects-store, --from-objects and --to-objects apply only to the source and destination sides of this sync. A side that omits its split-object flag is treated as a plain colocated store. Sync reports the unique objects copied, not the number of file references.

Both endpoints must be in-process stores (file://, s3://, gs://, b2://). External snapdir-*-store URLs — including ssh:// and sftp:// — are rejected; use fetch + push instead.

Mirror the destination manifest set

Add --delete when a local destination store should keep exactly the manifest set present in the source. sync still copies the requested snapshot first, then prunes destination manifests that are not present in the source. Objects are never deleted; garbage collection is intentionally separate.

sync --delete requires a local file:// destination and honors --dryrun. Object stores and remote stores are refused for mirror deletion.

Examples

Copy a snapshot between two S3 buckets:

snapdir sync --id 1220abc... --from s3://bucket-a/snapshots --to s3://bucket-b/snapshots

Copy a snapshot from S3 down to a local file store:

snapdir sync --id 1220abc... --from s3://my-bucket/snapshots --to file:///srv/backups

Sync split stores whose manifests and objects live in separate buckets:

snapdir sync --id 1220abc... --from s3://manifests-a --from-objects s3://objects-a --to gs://manifests-b --to-objects gs://objects-b

Mirror a source store's manifest set into a local store:

snapdir sync --id 1220abc... --from gs://feature-snapshots --to file:///srv/snapdir/features --delete

See also