When versioning is enabled for a bucket, overwritten or deleted data will be saved as previous version. Versioning allows you to restore previous versions of objects that have been overwritten or deleted.
- You cannot configure compliant retention policies or mirroring-based back-to-origin rules for a versioning-enabled bucket, nor enable versioning for a bucket that has compliant retention policies or mirroring-based back-to-origin rules configured.
- If versioning is enabled for a bucket, the
x-oss-forbid-overwriterequest header that is specified when an object is uploaded to the bucket will not take effect. For more information, see Request headers.
- When versioning is enabled for a bucket, all overwritten or deleted objects are saved as previous versions. OSS calculates the object size of each version and charges storage fees. To minimize storage costs, we recommend that you delete previous versions that are no longer needed in a timely manner.
- After you enable versioning for a bucket, the versioning state cannot be rolled back to unversioned. Versioning can only be enabled or suspended.
You can use one of the following methods to configure versioning.
|Console||User-friendly and intuitive web application|
|ossutil||High-performance command-line tool|
|OSS SDK for Java||SDK demos for various programming languages|
|OSS SDK for Python|
|OSS SDK for C++|
|OSS SDK for Go|
- Restore user data from accidental deletion
OSS does not provide the recycle bin function. To restore deleted data, you must use an offline or third-party backup tool.
- Restore overwritten data
Online collaborative documents and documents stored in online storage are frequently modified. In online office scenarios, a large number of temporary versions are generated when files are edited. Users must find versions of a certain point in time.
The versioning state of a bucket applies to all objects in the bucket. After you enable versioning for a bucket, all objects in the bucket are subject to versioning. Each version has a unique version ID.
- A bucket can be in any one of the following versioning states:
- The following users can configure versioning for buckets:
- Alibaba Cloud accounts
- RAM users or roles who have been granted OSSFullAccess
- RAM users or roles who have been granted PutBucketVersioning