---
title: "Object Versioning"
sidebar_label: "Versioning"
description: "What object versions and IDs are, how to enable or suspend versioning, and how versioning is billed"
sidebar_position: 7
---

import ArrowNestedIcon from 'docs-kit/icons/arrow-nested'
import Formbricks from '@theme/MDXComponents/Formbricks'

# Object Versioning

Versioning allows you to store and, if necessary, restore previous [object versions](#object-versions) — for example, if an object was accidentally deleted.

[Versioning can be enabled](#enable-versioning) in an existing bucket or when [creating a bucket](/s3/buckets/create-bucket.mdx).

## Object versions \{#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](/s3/objects/restore-object.mdx). Other object versions are non-current. There can be only one current version; the number of non-current versions is unlimited.

If versioning is enabled, when [uploading a new version of an object](/s3/objects/upload-object.mdx#reupload), the previous version is not overwritten but is added to the [list of object versions](#view-versions-list) marked with <ArrowNestedIcon /> with the same object name. Each version is assigned a [unique identifier](#version-id).

A previous version of an object can be [restored](/s3/objects/restore-object.mdx) to make it current.

Versions can be [managed](/s3/objects/) like regular objects (except for versions with the **Deleted** tag). If a [Bucket Policy](/s3/buckets/bucket-policy/) is created for the bucket, it must allow appropriate [actions with versions](/s3/buckets/bucket-policy/about-bucket-policy.mdx#actions).

### View the list of object versions \{#view-versions-list}

1. In the [control panel](https://my.selectel.ru/storage/), on the top menu, click **Products** and select **S3**.
2. Go to the **Buckets** section.
3. Open the bucket page → **Objects** tab.
4. Turn on the **Versions** switch.
5. Under the object row, you can see its versions — they are marked with <ArrowNestedIcon /> and have the same names.

## Version ID \{#version-id}

When versioning is enabled, each 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](#view-version-id) in the Control Panel.

If you [suspend versioning](#suspend-versioning), new objects will not be assigned a version ID — the value will be `null`. Older object versions will retain their version IDs.

### View the version ID \{#view-version-id}

1. In the [control panel](https://my.selectel.ru/storage/), on the top menu, click **Products** and select **S3**.
2. Go to the **Buckets** section.
3. Open the bucket page → **Objects** tab.
4. Turn on the **Versions** switch.
5. In the version row, view the ID in the **Version ID** column.

## Enable versioning \{#enable-versioning}

1. In the [control panel](https://my.selectel.ru/storage/), on the top menu, click **Products** and select **S3**.
2. Go to the **Buckets** section.
3. Open the bucket page → **Configuration** tab.
4. In the **Data protection** block, in the **Versioning** line, click **Edit**.
5. Turn on the toggle.
6. Click **Save**.

## Suspend versioning \{#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](/s3/buckets/object-lock.mdx) is enabled, versioning cannot be suspended.

1. In the [control panel](https://my.selectel.ru/storage/), click **Products** in the top menu and select **S3**.
2. Go to the **Buckets** section.
3. Open the bucket page → **Configuration** tab.
4. In the **Data protection** block, in the **Versioning** line, click **Edit**.
5. Turn off the toggle.
6. Click **Save**.

## Billing \{#tariffication}

Each version takes up storage space, and its [storage volume](/s3/about/payment.mdx#storage-volume) is charged. [Deleted versions](/s3/objects/delete-object.mdx#delete-object-with-versioning-enabled) and versions that have been moved to another bucket do not take up space, but are displayed in the version list with the **Deleted** tag.

<Formbricks />
