Skip to content

mongoshield verify

Check that a backup is complete and intact.

Terminal window
mongoshield verify [backup] [options]
ArgumentDescription
[backup]optionalBackup id, or "latest" (default)
OptionDescription
--deepAlso decrypt, decompress and parse every document (needs the key).
--drillRestore the backup into a scratch deployment and check it (see mongoshield drill).
--target-uri <mongodb-uri>Scratch deployment to restore into (required, or MONGOSHIELD_DRILL_URI; never the configured source).
--sample <n>Documents per collection to compare byte for byte with the backup (time series: field by field). Default: 0.
--assertions <file>A .ts/.js file whose default export checks the restored data.
--keepKeep the temporary databases for inspection.
--prefix <prefix>Prefix of the temporary database names. Default: msdrill_.
--allow-same-deploymentAllow the target to be the backup's own source deployment.
--include <pattern>Only these namespaces, e.g. app.* or app.users. Repeatable.
--exclude <pattern>Skip these namespaces, e.g. *.audit_*. Repeatable.
--from <storage-url>Where backups are stored: ./dir, file:///abs, s3://bucket/prefix (default: config).
--identity-file <path>age identity file for encrypted backups (from mongoshield keygen). Repeatable.
--passphrase-env <VAR>Read the encryption passphrase from this environment variable.
--chain <full|links>Incremental backups: also check every earlier backup's files (full), or only that the chain is intact (links). Default: full.

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

Quick check of the latest backup:

Terminal window
mongoshield verify

Full check of an encrypted backup:

Terminal window
mongoshield verify latest --deep --identity-file ~/keys/backup.key