mongoshield snapshot
Back up under a name before a migration.
mongoshield snapshot <label> [options]Takes a consistent backup labelled with <label>, to roll back to with mongoshield rollback <label> if the migration goes wrong. It is an ordinary backup: list, verify, hold and prune treat it like any other.
Arguments
Section titled “Arguments”| Argument | Description | |
|---|---|---|
<label> | required | A name for this point, e.g. v42-add-index |
Options
Section titled “Options”| Option | Description |
|---|---|
--uri <mongodb-uri> | Connection string (default: config source.uri, MONGOSHIELD_URI or MONGODB_URI). |
--to <storage-url> | Where to store the snapshot (default: config storage). |
--include <pattern> | Only these namespaces, e.g. app.* or app.users. Repeatable. |
--exclude <pattern> | Skip these namespaces, e.g. *.audit_*. Repeatable. |
--label <key=value> | Attach another label, e.g. migration=20261021-add-index. Repeatable. |
--retain-days <days> | Make the snapshot write-once for this many days (object lock storage). |
The global options (--config, --json, --quiet,
--verbose, --no-color, --yes) work here too.
Examples
Section titled “Examples”Snapshot the app database before migrating:
mongoshield snapshot v42-add-orders-index --include 'app.*'MongoShield is MIT licensed and is not affiliated with, endorsed by or sponsored by MongoDB, Inc. MongoDB is a trademark of MongoDB, Inc.Privacy policy