mongoshield rollback
Roll the database back to a snapshot.
mongoshield rollback [label] [options]Restores the newest snapshot with <label> over the live data, replacing each collection it contains, and drops the collections created after the snapshot in its databases (--keep-new keeps them). A safety snapshot (pre-rollback-<label>) of everything about to be replaced or dropped is taken first. Asks for confirmation unless --yes.
Arguments
Section titled “Arguments”| Argument | Description | |
|---|---|---|
[label] | optional | Snapshot label (or use --id) |
Options
Section titled “Options”| Option | Description |
|---|---|
--id <backup-id> | Roll back to this backup id instead of a label. |
--uri <mongodb-uri> | The deployment to roll back (default: config source.uri). |
--from <storage-url> | Where backups are stored: ./dir, file:///abs, s3://bucket/prefix (default: config). |
--include <pattern> | Only these namespaces, e.g. app.* or app.users. Repeatable. |
--exclude <pattern> | Skip these namespaces, e.g. *.audit_*. Repeatable. |
--mode <drop|upsert|insert|fail-if-exists> | How to put collections back. Default: drop. |
--dry-run | Show the plan and stop; write nothing. |
--keep-new | Keep the collections created after the snapshot instead of dropping them. |
--no-safety-snapshot | Do not snapshot the live collections before replacing them. |
--skip-erasures | Do not re-apply the GDPR erasure ledger afterwards. |
--identity-file <path> | age identity file for encrypted backups (from mongoshield keygen). Repeatable. |
--passphrase-env <VAR> | Read the encryption passphrase from this environment variable. |
The global options (--config, --json, --quiet,
--verbose, --no-color, --yes) work here too.
Examples
Section titled “Examples”Undo a failed migration:
mongoshield rollback v42-add-orders-indexPreview rolling back just one collection:
mongoshield rollback v42-add-orders-index --include app.orders --dry-runMongoShield is MIT licensed and is not affiliated with, endorsed by or sponsored by MongoDB, Inc. MongoDB is a trademark of MongoDB, Inc.Privacy policy