Skip to main content

Object Versioning

Versioning allows storing and, if necessary, restoring previous object versions — for example, if an object was accidentally deleted.

You can enable versioning 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. The remaining versions of the object are previous versions. There can only be one current version, while the number of previous versions is unlimited.

If versioning is enabled, when uploading a new version of an object, the previous version of the object is not overwritten, but added to the object version list with an label and the same object name. Each version is assigned a unique identifier.

A previous version of an object can be restored — made 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 corresponding actions on versions.

View the list of object versions

  1. In the control panel, in the top menu, click Products and select S3.
  2. Go to Buckets.
  3. Open the bucket page → Objects tab.
  4. Turn on the Versions toggle switch.
  5. Under the object row, view its versions — they are marked with and have identical names.

Version ID

When versioning is enabled, each version is assigned a version ID (version_id), which is a unique identifier. It can be used to manage any version of the object. You can view the version ID in the control panel.

If you suspend versioning, new objects will not be assigned version IDs — the value will be null. Older object versions will retain their version IDs.

View the version ID

  1. In the control panel, in the top menu, click Products and select S3.
  2. Go to Buckets.
  3. Open the bucket page → Objects tab.
  4. Turn on the Versions toggle switch.
  5. In the version row, view the ID in the Version ID column.

Enable versioning

  1. In the control panel, in the top menu, click Products and select S3.
  2. Go to Buckets.
  3. Open the bucket page → Configuration tab.
  4. In the Data protection block, in the Versioning row, click Edit.
  5. Turn on the toggle.
  6. Click Save.

Suspend versioning

After suspending versioning, the 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.

If Object Lock is enabled, versioning cannot be suspended.

  1. In the control panel, in the top menu, click Products and select S3.
  2. Go to Buckets.
  3. Open the bucket page → Configuration tab.
  4. In the Data protection block, in the Versioning row, click Edit.
  5. Turn off the toggle.
  6. Click Save.

Billing

Each version takes up storage space, and its storage volume is charged. 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.