Versioning Overview
If you want to restore a deleted file or restore a specific version of a file that is concurrently, frequently edited online, you can enable versioning for the OBS bucket. In a versioning-enabled bucket, OBS keeps multiple versions of the same object. This allows you to quickly retrieve and restore any object version, helping you recover data from both accidental actions and application failures.
Related Concepts
The following describes the concepts and statuses of versioning.
- Historical version: When versioning is enabled, if you upload an object with the same name as an existing object in the bucket, the existing object becomes a historical version.
- Current version: When versioning is enabled, each newly uploaded object is stored as the current version.
The Historical Versions switch above the object list controls whether historical object versions and delete markers (if any) are displayed:
- Switch enabled: The object list shows both the current version (or delete marker) and historical versions of each object.
- Switch disabled: The object list shows only the current version (excluding the delete marker) of each object.
- Version ID: When versioning is enabled, OBS assigns a globally unique identifier to every newly uploaded object. This identifier is called the version ID.
- null: When versioning is enabled, OBS assigns a version ID of null to any objects that were uploaded before versioning was enabled. When versioning is suspended, OBS assigns a version ID of null to any newly uploaded objects.
- Delete marker: When versioning is enabled, if you delete an existing object from the bucket, OBS inserts a delete marker, which becomes the current version of the object. Delete markers do not occupy storage and therefore are not billed.Figure 2 Inserting a delete marker
The versioning status of a bucket can be disabled, enabled, or suspended.
- Disabled (default): For a newly created OBS bucket, versioning is disabled by default. If you upload an object with the same name as an existing object, the new object overwrites the existing one.
- Enabled: When versioning is enabled, existing objects in the bucket do not automatically have copies. If you upload an object with the same name as an existing object, OBS treats the existing object as a copy of the newly uploaded one.
- Suspended: When versioning is suspended, whether existing objects have copies depends on whether those copies existed before suspension. If you upload an object with the same name as an existing object whose version ID is null, the new object overwrites that existing one.
How Versioning Works
The following explains how versioning works by describing the operations performed when versioning is disabled, enabled, and suspended.
Object Operations (Versioning Enabled)
Object Operations (Versioning Suspended)
Constraints
- Once versioning is enabled for a bucket, it cannot be disabled, but it can be suspended.
- Before enabling bucket-level WORM, you must enable versioning. Configuring WORM on OBS Console automatically enables versioning for the bucket, and versioning cannot be suspended afterward. When configuring WORM using APIs, you must first call the API that enables versioning for the bucket.
- ACLs, server-side encryption, and tags cannot be configured for historical object versions.
Access Control
Only the bucket owner and users granted the PutBucketVersioning permission can configure versioning. For details, see Assigning Permissions to an IAM User or Creating a Custom Bucket Policy (Visual Editor).
Billing
Versioning itself is free. However, storing the current version (excluding the delete marker) and all historical versions of each object incurs storage costs. To avoid unnecessary storage costs, delete objects promptly. You can either delete them manually or configure lifecycle rules to automate deletion.
How Versioning Works with Lifecycle Rules, WORM, and Cross-Region Replication
After versioning is enabled for a bucket, you can configure lifecycle rules to transition current or historical object versions to a different storage class, expire and delete current or historical object versions, or remove expired delete markers. For details, see Lifecycle Management Overview.
You can use WORM to set a retention period for all objects in a bucket. During this period, objects of any version cannot be deleted or modified. Versioning ensures that overwritten or deleted objects are preserved as historical versions, allowing recovery at any time. WORM and versioning together provide dual protection for data stored in buckets.
When you enable WORM for a bucket, OBS automatically enables versioning and versioning cannot be suspended later for that bucket.
WORM protects objects as follows:
- WORM protects all object versions. During the retention period, no object version can be deleted or overwritten.
- Uploading an object with the same name creates a new version, which is also protected by WORM.
- WORM does not apply to delete markers. Delete markers can still be removed during the retention period.
The following tables describe how versioning interacts with cross-region replication.
| Condition | Operation | Replication Result (Using OBS Console) | Replication Result (Using OBS APIs) | Replication Result (Using obsutil) |
|---|---|---|---|---|
| Source and destination buckets have the same versioning status (disabled, enabled, or suspended). | - | Replicated | Replicated | Replicated |
| Source and destination buckets have different versioning statuses (disabled, enabled, or suspended). | - | Not replicated | Not replicated | Not replicated |
| Cross-region replication within an account is enabled. | Change the versioning status of the source or destination bucket. | Not replicated | Not replicated | Not replicated |
| Source and destination buckets have their versioning enabled or suspended, and cross-region replication within an account is enabled. | Delete an object from the source bucket without specifying a version. | The object copy is synchronously deleted from the destination bucket. | ||
| Delete a specific version of an object from the source bucket. | The copy of the object version is synchronously deleted from the destination bucket. | |||
| Source and destination buckets have their versioning disabled, and cross-region replication within an account is enabled. | Delete an object from the source bucket. | The object copy is synchronously deleted from the destination bucket. | ||
To use cross-region replication within an account, the source and destination buckets must have the same versioning status (enabled or disabled).
| Condition | Operation | Replication Result (Using the OMS Console) | Replication Result (Using OMS APIs) | Replication Result (Using obsutil) |
|---|---|---|---|---|
| Source and destination buckets have the same versioning status (disabled, enabled, or suspended). | Upload or modify an object. | Replicated | Replicated | Replicated |
| Source and destination buckets have different versioning statuses (disabled, enabled, or suspended). | Upload or modify an object. | Replicated | Replicated | Not replicated |
| Source and destination buckets have versioning enabled or suspended. | Delete an object from the source bucket without specifying a version. | The object is not deleted from the destination bucket. | ||
| Delete a specific version of an object from the source bucket. | The object is not deleted from the destination bucket. | |||
| Source and destination buckets have versioning disabled. | Delete an object from the source bucket. | The object is not deleted from the destination bucket. | The object is not deleted from the destination bucket. | The object copy is synchronously deleted from the destination bucket. |
| Condition | Operation | Replication Result (Using the OMS Console) | Replication Result (Using OMS APIs) | Replication Result (Using OBS APIs) | Replication Result Using OBS SDKs | Replication Result (Using obsutil) |
|---|---|---|---|---|---|---|
| Source and destination buckets have the same versioning status (disabled, enabled, or suspended). | Upload or modify an object. | Replicated | Replicated | Replicated | Replicated | Replicated |
| Source and destination buckets have different versioning statuses (disabled, enabled, or suspended). | Upload or modify an object. | Replicated | Replicated | Not replicated | Not replicated | Not replicated |
| Source and destination buckets have versioning enabled or suspended. | Delete an object from the source bucket without specifying a version. | The object is not deleted from the destination bucket. | The object is not deleted from the destination bucket. | The object copy is synchronously deleted from the destination bucket. | The object copy is synchronously deleted from the destination bucket. | The object copy is synchronously deleted from the destination bucket. |
| Delete a specific version of an object from the source bucket. | The object is not deleted from the destination bucket. | The object is not deleted from the destination bucket. | The copy of the object version is synchronously deleted from the destination bucket. | The copy of the object version is synchronously deleted from the destination bucket. | The copy of the object version is synchronously deleted from the destination bucket. | |
| Source and destination buckets have versioning disabled. | Delete an object from the source bucket. | The object is not deleted from the destination bucket. | The object is not deleted from the destination bucket. | The object copy is synchronously deleted from the destination bucket. | The object copy is synchronously deleted from the destination bucket. | The object copy is synchronously deleted from the destination bucket. |
Helpful Links
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot



















