Versioning
Enable bucket versioning, recover earlier object versions, and manage delete markers with rc and the Console.
RustFS bucket versioning preserves multiple versions of the same object key. Use it to recover from accidental overwrites and deletes and to satisfy prerequisites for Object Lock and bucket replication.
Overview
When versioning is enabled:
- Each upload or copy to an existing key creates a new version ID.
- A normal delete creates a delete marker instead of removing older versions.
- Reading the key without a version ID returns the latest visible version, or
NotFoundwhen the latest entry is a delete marker. - Reading or deleting a specific version requires its version ID.
Suspending versioning stops normal creation of new version IDs but preserves existing versions and delete markers. Suspension is not the same as disabling or removing version history.
Configure in the Console
Enable at bucket creation
- Open Buckets and select Create Bucket.
- Enter the bucket name.
- Enable Version.
- Select Create.
Enable or suspend an existing bucket
- Open Buckets, locate the bucket, and select Settings.
- Under Data Protection, locate Versioning.
- Enable versioning or suspend it as required.
The settings page reports Enabled, Suspended, or Disabled. It also notes that suspension preserves existing versions.
Browse and recover versions
- Open the bucket and enable Show Deleted Objects when you need to see keys hidden by delete markers.
- Select an object name to open Object Details.
- Select Versions to inspect available versions and delete markers.
- Download the required version and upload it again to make its content the latest version.
Use rc
Create a bucket and enable versioning:
rc bucket create rustfs/my-bucket
rc bucket version enable rustfs/my-bucket
rc bucket version info rustfs/my-bucketUpload two versions of the same key:
printf 'version one\n' > /tmp/hello.txt
rc object copy /tmp/hello.txt rustfs/my-bucket/hello.txt
printf 'version two\n' > /tmp/hello.txt
rc object copy /tmp/hello.txt rustfs/my-bucket/hello.txt --overwriteList versions and record the version ID you want to recover:
rc bucket version list rustfs/my-bucket/hello.txt --json
rc object stat rustfs/my-bucket/hello.txt \
--version-id <version-id> --jsonRestore an earlier version by downloading its body and uploading it as a new latest version:
rc object show rustfs/my-bucket/hello.txt \
--version-id <version-id> > /tmp/hello-restored.txt
rc object copy /tmp/hello-restored.txt \
rustfs/my-bucket/hello.txt --overwriteDelete the current key to create a delete marker, then inspect it:
rc object remove rustfs/my-bucket/hello.txt --force
rc bucket version list rustfs/my-bucket/hello.txt --jsonThe latest entry should show is_delete_marker: true. The earlier versions remain available by version ID.
Suspend versioning when you no longer want normal writes to create new numbered versions:
rc bucket version suspend rustfs/my-bucket
rc bucket version info rustfs/my-bucketrc 0.1.29 version deletion boundary
rc object remove --versions is listed in the rc 0.1.29 help output but returns not implemented. Use the Console or an S3 SDK to permanently delete selected version IDs. Do not remove an entire version history unless you have verified retention, replication, and recovery requirements.
Verification
After enabling versioning:
- Upload the same key twice with different content.
- Run
rc bucket version listand confirm that both entries have distinct version IDs. - Retrieve each version with
rc object show --version-idand compare its content. - Delete the key without a version ID and confirm that a delete marker appears.
- Retrieve an older version by version ID to confirm it remains recoverable.
Operational considerations
- Versioning increases storage use because overwrites and deletes retain older data.
- Configure lifecycle rules for noncurrent versions only after defining recovery and retention periods.
- Bucket replication requires versioning on both source and destination buckets.
- Object Lock depends on versioning and protects individual versions.
- Multipart completion creates one new object version in a versioned bucket.