All backup guides

Back up files with S3 Object Lock

S3 Object Lock can stop a stored backup object from being deleted or changed until a date passes. The storage provider enforces the lock. Object Lock has to be on when the bucket is created; no app can turn it on for an existing bucket.

From version 2.0, MomentBackup sets those dates itself with Write protection on the bucket’s page. Version 1.0 relies on the bucket’s own default retention.

1. Create the bucket first

Use a provider that supports S3 Versioning and Object Lock. The exact screens vary. For Amazon S3, enable Bucket Versioning and Object Lock when you create the bucket. AWS documents the full setup.

  • Version 2.0 and later: leave the bucket’s default retention off. Write protection dates each restore point and the data it needs.
  • Version 1.0: set a default retention period under the bucket’s Properties tab. On Amazon S3, Governance lets a specially allowed account bypass the lock; Compliance can’t be shortened through normal S3 controls.

Keep public access blocked. Create least-privilege credentials for an IAM user, scoped to this bucket and the prefix MomentBackup will use. Do not use an administrator key. For write protection, the key also needs to read the bucket’s Object Lock setting, read and set object retention, list object versions, and delete object versions. MomentBackup only deletes delete markers, never stored data.

Other S3-compatible providers may use different modes and rules. Read their own Object Lock documentation. Locked versions use storage until their retention dates pass, so a longer period costs more.

2. Connect the bucket

In MomentBackup, open Destinations, choose Add a place, then choose Object storage. Enter the endpoint, region, bucket, optional folder prefix, access key ID, and secret key supplied by the provider.

An S3 backup copy keeps the primary repository’s encryption state. If the primary is encrypted, save its recovery key somewhere separate. S3 destinations hold file versions, not system images.

3. Turn on write protection (version 2.0 and later)

Open the bucket’s page in Destinations. Next to Write protection, choose 7, 14, 30 or 90 days. Each new restore point, and the data it needs, can’t be deleted or changed until its protection ends. MomentBackup uses compliance mode.

  • Turning it off affects new restore points only.
  • Cleanup keeps a protected restore point until its protection ends, and the provider bills its storage until then.

If someone deletes files from the bucket while their protection lasts, the bucket’s page offers Bring back…. It says how many files it found and asks first. It removes the delete markers so the backup reads again, and never deletes stored data. A file whose protection already ended can’t be brought back.

4. Check the provider applied the lock

Run a backup and wait for it to finish. If S3 is a second copy, also wait for the copy to finish. In the provider’s console, inspect one new object version. It should show a retention mode and a future retain-until date.

If it does not, stop: versioning alone keeps old versions, but it does not make them undeletable. Fix the bucket settings before relying on it. Use a disposable test object and the same scoped permission policy to confirm that all versions can be listed, deletion is refused, and the retained version can still be read. Do not run a deletion test against the only copy of a real backup.

Finally, restore one small file through Backup Explorer and open it.

Need a hand? Email [email protected]. Ready to start? Download MomentBackup.