{"slug":"object-storage-versioning","title":"Object Storage versioning","description":"Protect your data against accidental deletion and overwrites with bucket versioning.","section":"Features","url":"https://docs.danubedata.ro/object-storage-versioning","markdown_url":"https://docs.danubedata.ro/object-storage-versioning.md","breadcrumbs":[{"title":"Features","slug":null},{"title":"Storage","slug":"storage-overview"},{"title":"Versioning","slug":"object-storage-versioning"}],"headings":[{"level":1,"title":"Object Storage versioning","id":"object-storage-versioning"},{"level":2,"title":"Overview","id":"overview"},{"level":2,"title":"Versioning states","id":"versioning-states"},{"level":3,"title":"Key points","id":"key-points"},{"level":2,"title":"How to enable or suspend versioning","id":"how-to-enable-or-suspend-versioning"},{"level":3,"title":"Via dashboard","id":"via-dashboard"},{"level":3,"title":"Via CLI","id":"via-cli"},{"level":2,"title":"How versioning affects storage and billing","id":"how-versioning-affects-storage-and-billing"},{"level":3,"title":"Example","id":"example"},{"level":2,"title":"Common issue: storage usage higher than expected","id":"common-issue-storage-usage-higher-than-expected"},{"level":3,"title":"Why this happens","id":"why-this-happens"},{"level":3,"title":"How to verify","id":"how-to-verify"},{"level":3,"title":"How to clean up old versions","id":"how-to-clean-up-old-versions"},{"level":2,"title":"Lifecycle rules for automatic cleanup","id":"lifecycle-rules-for-automatic-cleanup"},{"level":2,"title":"Best practices","id":"best-practices"},{"level":2,"title":"FAQ","id":"faq"},{"level":3,"title":"Does enabling versioning duplicate my existing objects?","id":"does-enabling-versioning-duplicate-my-existing-objects"},{"level":3,"title":"I suspended versioning. Why is my storage still high?","id":"i-suspended-versioning-why-is-my-storage-still-high"},{"level":3,"title":"How do delete markers work?","id":"how-do-delete-markers-work"},{"level":3,"title":"Can I restore a deleted object?","id":"can-i-restore-a-deleted-object"},{"level":2,"title":"Next steps","id":"next-steps"}],"format":"markdown","word_count":853,"content":"# Object Storage versioning\n\nProtect your data against accidental deletion and overwrites with bucket versioning.\n\n## Overview\n\nVersioning 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.\n\n## Versioning states\n\nA bucket can be in one of three versioning states:\n\n| State | Description |\n|-------|-------------|\n| **Disabled** | Default state. No versioning. Uploads overwrite existing objects. |\n| **Enabled** | Every upload creates a new version. Deletes create a delete marker instead of removing data. |\n| **Suspended** | Stops creating new versions for future uploads. Existing versions are preserved. |\n\n### Key points\n\n- Versioning only applies to **future uploads** — enabling it does not retroactively create versions of existing objects.\n- Suspending versioning does **not** delete existing versions — they remain in the bucket and continue to consume storage.\n- Once versioning has been enabled on a bucket, it cannot be fully disabled, only suspended.\n\n## How to enable or suspend versioning\n\n### Via dashboard\n\n1. Navigate to **Object Storage** in the sidebar\n2. Click on your bucket\n3. Go to **Settings**\n4. Toggle **Versioning** to enable or suspend\n5. Save changes\n\n### Via CLI\n\nYou can also manage versioning with the AWS CLI:\n\n```bash\n# Enable versioning\naws --endpoint-url https://s3.danubedata.ro s3api put-bucket-versioning \\\n  --bucket my-bucket \\\n  --versioning-configuration Status=Enabled\n\n# Suspend versioning\naws --endpoint-url https://s3.danubedata.ro s3api put-bucket-versioning \\\n  --bucket my-bucket \\\n  --versioning-configuration Status=Suspended\n\n# Check current versioning status\naws --endpoint-url https://s3.danubedata.ro s3api get-bucket-versioning \\\n  --bucket my-bucket\n```\n\n## How versioning affects storage and billing\n\nAll object versions (current and non-current) count toward your total storage usage and are billed accordingly.\n\n### Example\n\nYou upload a 10 GB backup file daily for 5 days with the same key:\n\n- **Without versioning** — 10 GB stored (each upload overwrites the previous one)\n- **With versioning** — 50 GB stored (5 separate versions are kept)\n\nThis 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.\n\n## Common issue: storage usage higher than expected\n\nIf 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.\n\n### Why this happens\n\n1. You enabled versioning on your bucket\n2. You uploaded, overwrote, or deleted objects — creating non-current versions and delete markers\n3. You later suspended versioning\n4. The old versions still exist and consume storage, but they are not visible in a standard object listing\n\n### How to verify\n\nUse the **Object Browser** in the dashboard with versioning enabled to see all versions, or use the AWS CLI:\n\n```bash\n# List all versions (including non-current)\naws --endpoint-url https://s3.danubedata.ro s3api list-object-versions \\\n  --bucket my-bucket\n\n# List only current objects for comparison\naws --endpoint-url https://s3.danubedata.ro s3 ls s3://my-bucket/ \\\n  --recursive --summarize\n```\n\n### How to clean up old versions\n\nTo reclaim storage used by old versions:\n\n1. **Re-enable versioning** on the bucket from the dashboard (Settings)\n2. Open the **Object Browser** in the dashboard\n3. Locate and delete the non-current (old) versions you no longer need\n\nYou can also use the AWS CLI to delete specific versions:\n\n```bash\n# Delete a specific object version\naws --endpoint-url https://s3.danubedata.ro s3api delete-object \\\n  --bucket my-bucket \\\n  --key my-file.txt \\\n  --version-id \"abc123-version-id\"\n```\n\n## Lifecycle rules for automatic cleanup\n\nTo prevent old versions from accumulating indefinitely, set up a lifecycle rule to automatically expire non-current versions:\n\n```bash\naws --endpoint-url https://s3.danubedata.ro s3api put-bucket-lifecycle-configuration \\\n  --bucket my-bucket \\\n  --lifecycle-configuration '{\n    \"Rules\": [\n      {\n        \"ID\": \"expire-old-versions\",\n        \"Status\": \"Enabled\",\n        \"NoncurrentVersionExpiration\": {\n          \"NoncurrentDays\": 30\n        },\n        \"Filter\": {}\n      }\n    ]\n  }'\n```\n\nThis automatically deletes non-current versions older than 30 days.\n\n## Best practices\n\n1. **Use lifecycle rules** — Always pair versioning with a lifecycle rule to auto-expire old versions and control storage costs.\n2. **Monitor storage usage** — Check your dashboard regularly to ensure storage consumption matches expectations.\n3. **Clean up before suspending** — If you no longer need versioning, delete non-current versions before suspending to avoid paying for unused data.\n4. **Use versioning for critical data** — Backups, configuration files, and important documents benefit most from versioning.\n\n## FAQ\n\n### Does enabling versioning duplicate my existing objects?\n\nNo. Versioning only applies to future uploads. Existing objects are not affected until they are overwritten or deleted.\n\n### I suspended versioning. Why is my storage still high?\n\nSuspending 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.\n\n### How do delete markers work?\n\nWhen 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.\n\n### Can I restore a deleted object?\n\nYes. 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.\n\n## Next steps\n\n- [Object Storage product overview](../products/object-storage.md) — Full feature documentation\n- [Object Storage security](./object-storage-security.md) — Access control and encryption\n- [Quick start: create your first bucket](../getting-started/object-storage-quickstart.md) — Get started guide\n\n---\n\n**Questions?** Contact support at support@danubedata.ro\n","prev":{"title":"S3 Access Keys","slug":"object-storage-access-keys","url":"https://docs.danubedata.ro/object-storage-access-keys","markdown_url":"https://docs.danubedata.ro/object-storage-access-keys.md","json_url":"https://docs.danubedata.ro/object-storage-access-keys.json"},"next":{"title":"Volumes","slug":"volumes","url":"https://docs.danubedata.ro/volumes","markdown_url":"https://docs.danubedata.ro/volumes.md","json_url":"https://docs.danubedata.ro/volumes.json"},"index_url":"https://docs.danubedata.ro/index.json"}