Skip to main content

Versioning

The versioning feature of Arvancloud Object Storage lets you store and restore several versions of a file in a bucket. When this feature is enabled and several write requests are sent for an object, Arvancloud Object Storage keeps all versions of this file in the bucket. From then on, every file has one current version and may have several noncurrent versions (with a Version ID). For example, if you delete an object from a bucket with versioning enabled, a delete marker is added to it and it becomes a noncurrent version; or if you overwrite a file, a new version of that file is created in the bucket.

Versioning is disabled by default, and you can enable it for free on any bucket you need.

Enabling Versioning​

In the Buckets menu, select the bucket you want to enable versioning on and go to Actions. You can also enable versioning when creating a new bucket.

Click Edit next to Versioning to change this feature's status to enabled.

From then on, you can store different versions of an object in the bucket. This feature applies to all objects in a bucket, and every new object you upload to it is versioned and gets a unique identifier called a version ID. Files already in the bucket are also versioned from then on.

Note that objects that were in the bucket before versioning was enabled get the version ID null. These objects don't change when versioning is enabled, and their new versions are stored in the bucket with unique version IDs.

With versioning enabled, each object has one current version and can have several noncurrent versions. Now:

  • If you delete an object, instead of deleting it permanently, its current version is deleted. You can then restore its previous versions using the API.
  • If you overwrite an object, a new version of that object is added to the bucket and the previous version becomes a noncurrent version, which you can restore at any time.

The current version is an object's latest version.

Restoring Versions​

When versioning is enabled on a bucket, you can see the available versions of a file and their details in the panel by selecting Versions from the actions menu next to each object.

In the same section, you can download or delete the version you want and change its public read status.

If you delete an object or file from a versioned bucket with the API, a delete marker is added to its current version. After that, you can't get this file with a GET request and you get a 404 error. This object isn't shown in the Object Storage panel either, but you can still get its previous versions with the API.

Note that if there's no version other than the current version in the bucket, the object is deleted completely and permanently and can't be restored. Also, deleting an object from the panel deletes all its versions, and it can't be restored.

Disabling Versioning​

To disable a bucket's versioning, go to Actions and click Edit to change its status to disabled.

When versioning is disabled, objects' previous versions are still accessible, and:

  • Lifecycle rules set for previous versions are applied;
  • The current version of objects in the bucket doesn't change;
  • Uploading a new object with a duplicate name replaces the object's current version.