Object Versioning
Versioning allows you to store and, if necessary, restore previous object versions — for example, if an object was accidentally deleted.
Versioning can be enabled in an existing bucket or when creating a bucket.
Object versions
An object is considered a version of another if it has the same name and was uploaded again.
The current version is the object that was uploaded last or the object that was restored from a previous version. All other object versions are previous versions. There can only be one current version, while there is no limit on the number of previous versions.
If versioning is enabled, when uploading a new version of an object, the previous version of the object is not overwritten; instead, it is added to the list of object versions with the tag and the same object name. Each version is assigned a unique identifier.
A previous version of an object can be restored to make it current.
Versions can be managed like regular objects (except for versions with the Deleted tag). If a bucket policy is created in the bucket, it must allow the appropriate actions with versions.
View the list of object versions
- In the control panel, on the top menu, click Products and select S3.
- Go to the Buckets section.
- Open the bucket page → Objects tab.
- Turn on the Versions switch.
- Under the object row, you can see its versions — they are marked with and have the same names.
Version ID
When versioning is enabled, every version is assigned a version ID (version_id) — a unique identifier. You can use it to manage any object version. You can view the version ID in the control panel.
If you suspend versioning, no version ID will be assigned to new objects — the value will be null. Old object versions will retain their version IDs.
View the version ID
- In the control panel, on the top menu, click Products and select S3.
- Go to the Buckets section.
- Open the bucket page → Objects tab.
- Turn on the Versions switch.
- In the version row, view the ID in the Version ID column.
Enable versioning
- In the control panel, on the top menu, click Products and select S3.
- Go to the Buckets section.
- Open the bucket page → Configuration tab.
- In the Versioning block, select Enabled.
Suspend versioning
After versioning is suspended, existing object versions will not be deleted.
When uploading a new version, it will overwrite the current version and will not be saved in the version list.
- In the control panel, go to the top menu, click Products and select S3.
- Go to the Buckets section.
- Open the bucket page → Configuration tab.
- In the Versioning block, select Suspended.
- Click Save.
Billing
Each version takes up storage space, and its storage volume is billed. Deleted versions and versions that were moved to another bucket do not take up space but are displayed in the version list with the Deleted tag.