Docs Menu
Docs Home
/ /

Immutable S3 Snapshots with Object Lock

Ops Manager can store snapshots in an S3 or S3-compatible object store by writing snapshot data as blocks to an S3 bucket and tracking metadata in the Ops Manager application database. With immutable S3 snapshots, Ops Manager integrates with S3 Object Lock or an equivalent to provide the following capabilities:

  • Store snapshot data and backup metadata together in the S3 bucket.

  • Protect snapshot objects from deletion or modification until a defined retention period expires, enforced by the object store.

  • Import snapshots from an Object-Lock-enabled bucket into a new or rebuilt Ops Manager deployment for disaster recovery or migration.

Use this feature to protect backups against malicious or accidental deletion, such as ransomware attacks or operator error. You can restore backups in a new Ops Manager instance using only what you store in S3.

Important

This feature requires Ops Manager 8.0.19 or later.

After you configure an S3 snapshot store with an Object-Lock-enabled bucket and enable immutable backups:

  • Ops Manager writes snapshot blocks and the metadata required for restore into the S3 bucket, instead of keeping metadata only in the Ops Manager application database.

  • If configured, Ops Manager extends the Object Lock retention for each snapshot so that the object store prevents deletion or modification before the backup job retention window ends.

  • Ops Manager can discover and import these immutable snapshots from a pre-populated bucket into another Ops Manager instance by reading only what the S3 bucket stores.

To use immutable S3 snapshots, ensure you have the following:

  • Ops Manager 8.0.19 or later, which includes support for snapshot immutability and S3 import.

  • S3 snapshot store (blockstore) configured in Ops Manager. Immutable snapshots support only S3-based snapshot stores, not MongoDB blockstores or filesystem snapshot stores.

  • Object store that supports Object Lock, such as AWS S3 or compatible appliances, with Object Lock enabled on the bucket. Most S3 providers require Object versioning for Object Lock to function, and some providers allow Object Lock only during bucket creation.

  • Standard backup requirements, such as a MongoDB Agent with backup enabled on suitable nodes and an oplog (operations log) store for point-in-time recovery (PITR).

Important

Immutable S3 snapshots protect snapshot data only. Oplog slices used for PITR continue to use your configured oplog store, which does not support Object Lock. Using an Object-Lock-enabled bucket for oplogs might cause failures in the oplog deletion path.

When you plan immutable S3 snapshots, consider the following items:

  • No retroactive immutability. Ops Manager protects only snapshots written to a bucket with Object Lock after you enable immutable backup. Ops Manager does not apply Object Lock to existing snapshot objects.

  • Object Lock configuration. Ops Manager does not provide immutability for S3 buckets that do not support Object Lock. You must configure Object Lock on the bucket separately. Configuring Object Lock settings in Ops Manager or updating bucket settings after creation does not enable Object Lock on the bucket.

  • No automatic migration of existing data. The Migrate Backup Between S3 Stores feature lets you change which S3 snapshot store a backup job uses for future snapshots. It does not copy or move existing snapshot data between buckets.

  • Retention and Object Lock on managed stores. When a snapshot ages out according to the backup job retention policy, Ops Manager stops exposing it and attempts to delete related objects. Ops Manager can delete the objects only after the Object Lock retention period expires.

  • Retention on imported stores. Ops Manager never deletes data from imported stores. Retention affects only metadata visibility in Ops Manager.

To configure immutable S3 snapshots, complete the following tasks:

  1. Enable immutable backups in Ops Manager.

  2. Create an Object-Lock-enabled S3 bucket.

  3. Configure a new S3 snapshot store in Ops Manager.

  4. Switch existing backup jobs to the immutable S3 store.

A feature flag in Ops Manager controls immutable backups. You must enable this flag before you configure the S3 snapshot store.

1

On the Ops Manager host, open the configuration file. For example, conf-mms.properties.

2

Add or update the following property:

brs.immutableBackupEnabled=true

This flag enables S3 snapshot immutability for stores backed by Object-Lock-enabled buckets.

3

Restart Ops Manager so the configuration change takes effect.

1

In your S3 or S3-compatible object storage system, create a new bucket dedicated to immutable MongoDB backups.

2

Enable Object Lock during bucket creation. Most S3 providers require Object versioning for Object Lock to work.

3

Configure a default retention mode and period in your object store.

Note

You cannot enable Object Lock for an existing S3 snapshot store in Ops Manager. If you already use an S3 bucket for backups but need immutable snapshots, create a new bucket with Object Lock enabled and configure a new S3 snapshot store.

1

In Ops Manager, create a new S3 snapshot store that points to the Object-Lock-enabled bucket.

2

Specify the bucket name, endpoint, region, and credentials as required by your S3 provider. Ensure that the Object Lock settings in Ops Manager match the settings on your S3 bucket.

3

Ops Manager automatically validates connectivity when you save the store.

This snapshot store serves as the target for immutable snapshots. Ops Manager writes both snapshot blocks and metadata for backups that use this store into the bucket.

Note

You still need a MongoDB instance to act as a metadata store for Ops Manager operations.

For each backup job you want to protect with immutable snapshots:

1

Confirm that the job is Active and uses S3 as its snapshot store type.

2

Use the Admin UI or the backup API to update the backup job S3 snapshot store ID to the new immutable S3 store. Ops Manager stores this assignment in the backup job document.

3

After you change the store, Ops Manager schedules the next snapshot as a full snapshot on the new store. Any in-progress snapshot continues against the original store. Ops Manager forces the following snapshot to be a full snapshot on the new store.

When you switch stores:

  • Existing snapshots remain in the old store. Ops Manager does not move snapshots taken before the switch. They remain in the original S3 bucket and restore from that store until they expire based on your configured retention policy.

  • The first snapshot on the new store is full. This guarantees that Ops Manager stores all blocks for that snapshot in a single S3 snapshot store. Each restore fetches data from exactly one store.

  • Subsequent snapshots are incremental. Snapshots after the first full snapshot on the new store use incremental backup behavior.

If you need to restore data from a pre-existing S3 bucket that contains immutable snapshots and backup metadata, you can import those snapshots into an Ops Manager deployment. Use this workflow for disaster recovery scenarios, such as restoring backups after rebuilding Ops Manager.

Important

Imported snapshots are for one-time restore operations only. Ops Manager does not manage the lifecycle of imported snapshots or include them in active backup schedules.

1

In Ops Manager, register the bucket as an import snapshot store.

2

Run the snapshot import workflow to scan the bucket, validate metadata, and register available snapshots in a target project.

3

After you import snapshots, they appear as an independent cluster in the project, separate from clusters with active backup schedules. You can use these snapshots for restore operations.

Ops Manager never deletes or grooms data from imported stores. You control the lifecycle of imported snapshot objects at the object storage layer.

Point-in-time restore (PITR) combines a baseline snapshot with oplog data stored in an oplog store. Immutable snapshots affect only the baseline snapshot component:

  • When you switch to an immutable S3 snapshot store, PITR continues to work from existing snapshots and oplog data. Old snapshots remain in their original store, and the oplog store configuration does not change.

  • After the first full immutable snapshot completes on the new store, PITR can use that snapshot as the baseline and continue tailing oplogs from your configured oplog store.

  • PITR is not available for imported snapshots. You can restore imported snapshots only to the exact point when Ops Manager created the snapshot.

Immutable S3 snapshots do not introduce additional data-loss scenarios when you switch snapshot stores. Each snapshot restores from a single store, so restore logic does not require data from multiple buckets for one snapshot.

  • All existing snapshots remain in the original S3 store and are fully restorable.

  • PITR works from the most recent completed snapshot and oplog data.

  • Ops Manager marks the in-progress snapshot to the new store as failed or incomplete and does not use it for restores.

  • The last successful snapshot in the original store remains the latest restorable snapshot.

  • After Ops Manager and the cluster recover, Ops Manager schedules a new full snapshot to the immutable store at the next snapshot window.

Because the first snapshot on the new store is always a full snapshot and each snapshot restores from a single store, restore logic does not depend on mixing data from multiple S3 buckets for a single snapshot.

Back

Direct S3 Restore