Skip to content

mongoshield replicate

Copy backups to another storage location (3-2-1).

Terminal window
mongoshield replicate [backups] [options]

Streams every file of each backup from the backup storage to --to, checks each copy against its recorded SHA-256, and writes the manifest last. Backups already there are skipped; the erasure ledger and annotations are copied too.

ArgumentDescription
[backups]optionalWhich: "all" (default), "latest", or a backup id
OptionDescription
--to <storage-url>Destination: ./dir, s3://bucket/prefix, gs://…, az://…, sftp://….
--from <storage-url>Where backups are stored: ./dir, file:///abs, s3://bucket/prefix (default: config).
--id <backup-id>Copy these backups (repeatable), instead of the positional. Repeatable.
--retain-days <days>Make the copies write-once at the destination for this many days.
--no-verifyDo not read copies back to check them (faster, less safe).
--dry-runShow what would be copied; copy nothing.

The global options (--config, --json, --quiet, --verbose, --no-color, --yes) work here too.

Keep an off-site, write-once copy of the newest backup:

Terminal window
mongoshield replicate latest --to s3://offsite-backups/prod --retain-days 30

Bring a second copy fully up to date:

Terminal window
mongoshield replicate all --to /mnt/nas/mongo