Object Storage versioning
Protect your data against accidental deletion and overwrites with bucket versioning.
Overview
Versioning keeps multiple variants of an object in the same bucket. When enabled, every time you upload an object with the same key, a new version is created instead of overwriting the existing one. This allows you to recover previous versions of your data.
Versioning states
A bucket can be in one of three versioning states:
| State | Description |
|---|---|
| Disabled | Default state. No versioning. Uploads overwrite existing objects. |
| Enabled | Every upload creates a new version. Deletes create a delete marker instead of removing data. |
| Suspended | Stops creating new versions for future uploads. Existing versions are preserved. |
Key points
- Versioning only applies to future uploads — enabling it does not retroactively create versions of existing objects.
- Suspending versioning does not delete existing versions — they remain in the bucket and continue to consume storage.
- Once versioning has been enabled on a bucket, it cannot be fully disabled, only suspended.
How to enable or suspend versioning
Via dashboard
- Navigate to Object Storage in the sidebar
- Click on your bucket
- Go to Settings
- Toggle Versioning to enable or suspend
- Save changes
Via CLI
You can also manage versioning with the AWS CLI:
# Enable versioning
aws --endpoint-url https://s3.danubedata.ro s3api put-bucket-versioning \
--bucket my-bucket \
--versioning-configuration Status=Enabled
# Suspend versioning
aws --endpoint-url https://s3.danubedata.ro s3api put-bucket-versioning \
--bucket my-bucket \
--versioning-configuration Status=Suspended
# Check current versioning status
aws --endpoint-url https://s3.danubedata.ro s3api get-bucket-versioning \
--bucket my-bucket
How versioning affects storage and billing
All object versions (current and non-current) count toward your total storage usage and are billed accordingly.
Example
You upload a 10 GB backup file daily for 5 days with the same key:
- Without versioning — 10 GB stored (each upload overwrites the previous one)
- With versioning — 50 GB stored (5 separate versions are kept)
This is the most common reason for unexpected storage usage. If your dashboard shows more storage than you expect, old object versions are likely the cause.
Common issue: storage usage higher than expected
If your total storage usage is higher than the actual data you see in your bucket, it is almost certainly caused by non-current object versions or delete markers from a period when versioning was active.
Why this happens
- You enabled versioning on your bucket
- You uploaded, overwrote, or deleted objects — creating non-current versions and delete markers
- You later suspended versioning
- The old versions still exist and consume storage, but they are not visible in a standard object listing
How to verify
Use the Object Browser in the dashboard with versioning enabled to see all versions, or use the AWS CLI:
# List all versions (including non-current)
aws --endpoint-url https://s3.danubedata.ro s3api list-object-versions \
--bucket my-bucket
# List only current objects for comparison
aws --endpoint-url https://s3.danubedata.ro s3 ls s3://my-bucket/ \
--recursive --summarize
How to clean up old versions
To reclaim storage used by old versions:
- Re-enable versioning on the bucket from the dashboard (Settings)
- Open the Object Browser in the dashboard
- Locate and delete the non-current (old) versions you no longer need
You can also use the AWS CLI to delete specific versions:
# Delete a specific object version
aws --endpoint-url https://s3.danubedata.ro s3api delete-object \
--bucket my-bucket \
--key my-file.txt \
--version-id "abc123-version-id"
Lifecycle rules for automatic cleanup
To prevent old versions from accumulating indefinitely, set up a lifecycle rule to automatically expire non-current versions:
aws --endpoint-url https://s3.danubedata.ro s3api put-bucket-lifecycle-configuration \
--bucket my-bucket \
--lifecycle-configuration '{
"Rules": [
{
"ID": "expire-old-versions",
"Status": "Enabled",
"NoncurrentVersionExpiration": {
"NoncurrentDays": 30
},
"Filter": {}
}
]
}'
This automatically deletes non-current versions older than 30 days.
Best practices
- Use lifecycle rules — Always pair versioning with a lifecycle rule to auto-expire old versions and control storage costs.
- Monitor storage usage — Check your dashboard regularly to ensure storage consumption matches expectations.
- Clean up before suspending — If you no longer need versioning, delete non-current versions before suspending to avoid paying for unused data.
- Use versioning for critical data — Backups, configuration files, and important documents benefit most from versioning.
FAQ
Does enabling versioning duplicate my existing objects?
No. Versioning only applies to future uploads. Existing objects are not affected until they are overwritten or deleted.
I suspended versioning. Why is my storage still high?
Suspending versioning stops new versions from being created, but it does not remove existing non-current versions. You must delete them manually or via a lifecycle rule.
How do delete markers work?
When you delete an object with versioning enabled, the object is not actually removed. Instead, a "delete marker" is placed on top of it. The object appears deleted, but all previous versions still exist and consume storage.
Can I restore a deleted object?
Yes. If versioning was enabled when the object was deleted, you can restore it by removing the delete marker or by downloading a specific previous version.
Next steps
- Object Storage product overview — Full feature documentation
- Object Storage security — Access control and encryption
- Quick start: create your first bucket — Get started guide
Questions? Contact support at support@danubedata.ro