Skip to navigationSkip to main contentSkip to footerScaleway Docs HomepageAsk our AI
Ask our AI

How to use bucket versioning

Versioning is a feature designed to keep multiple variants of an object in the same bucket. When enabled, it allows you to store, retrieve, and restore every version of your objects stored in a bucket.

Versioning allows you to easily recover your objects in case of unintended user actions or application failures.

Before you start

To complete the actions presented below, you must have:

  • A Scaleway account logged in to the console
  • Owner status or IAM permissions allowing you to perform actions in the intended Organization

Versioning overview

General concepts

  • Version ID: a unique identifier generated for each object write. Combined with the object key, it forms the full object address. Without versioning, the key alone identifies the object.
  • Current version: the most recent write. The console object list and any GET request without a version ID return this version by default.
  • Non-current (previous) version: any older write. Non-current versions remain stored, are billable, and can be retrieved by version ID.
  • Delete marker: a placeholder current version that a DELETE operation inserts on a versioned bucket. The object appears removed, but prior versions remain intact. Removing the delete marker restores the object.
  • null version: an object written before versioning was enabled, or while versioning is suspended. It has no version ID, and only one null version exists per key.
  • Versioning states: a bucket is Unversioned (versioning never enabled), Enabled, or Suspended. Once enabled, versioning cannot return to the Unversioned state, only to Suspended.

Object and bucket behavior

An object version behaves like a regular object, except that a combination of the object key and a version ID identifies it, rather than the key alone.

Buckets with versioning enabled observe the following behavior:

SituationWhat happens to existing objectsWhat happens to new objects
Versioning never enabledEvery object uploaded has a single null version.Overwrites permanently replace the previous object, and deletes remove it completely.
Versioning enabled from the startEvery object uploaded receives a unique version ID.Each subsequent write creates a new version automatically.
Versioning disabled initially, then enabledObjects uploaded before the switch remain as a null version and are not versioned.New objects are versioned, and overwrites create new versions.
Versioning enabled, then suspendedExisting versions stay exactly as they are, and are not removed automatically.New objects do not get a version ID. Overwrites replace the current null version, but older versions remain in place.
Versioning enabled, then bucket deletedAll versions are deleted together when the bucket is removed.N/A

How to enable versioning

This procedure explains how to enable versioning on an existing bucket. To create a new bucket with versioning enabled, refer to the bucket creation documentation.

  1. Click Object Storage in the Storage section of the side menu. A list of your buckets displays.
  2. Click the name of the bucket in which you want to enable versioning.
  3. Click the Bucket settings tab.
  4. Scroll down and click the toggle toggle icon under Bucket versioning. A pop-up appears.
  5. Type ENABLE to confirm your action, then click Enable bucket versioning to proceed.

Once versioning is enabled, uploading an object with the same name as an existing object creates a new version of it. This new version consumes storage as well, which may lead to higher costs.

How to manage object versions

View object versions

  1. Click Object Storage in the Storage section of the side menu. A list of your buckets displays.

  2. Click the name of your versioned bucket. A list of the objects it contains appears.

  3. Click more icon next to the object you want to manage, then click Versioning. A side-panel displays, containing the different versions of your object.

    Each object version displays the following elements:

    • A unique version ID
    • A status badge (CURRENT, PREVIOUS, or DELETE MARKER)
    • The date of last modification
    • The size of the version
    • The storage class
    • The object lock indicator

Add a new object version

To add a new object version, upload an object with the same key as an existing one.

Restore an object to a previous version

The Scaleway console does not currently provide a native restore action. To restore an object to a previous version, download the desired non-current version and upload it again. This action replaces the current version with the uploaded one.

How to delete an object or a version

When versioning is enabled, deleting an object inserts a delete marker as the current version rather than removing the object. You can also permanently delete a specific version of an object.

Insert a delete marker

  1. Click Object Storage in the Storage section of the side menu. A list of your buckets displays.
  2. Click the name of your versioned bucket. A list of the objects it contains appears.
  3. Click more icon next to the object you want to manage, then click Versioning. A side-panel displays, containing the different versions of your object.
  4. Click Mark as deleted at the bottom of the side panel. A delete marker is inserted as the current version of your object.

Objects with a delete marker as their current version do not appear in console listings, and return errors when called via the API or CLI tools. Previous versions persist and remain billable.

Delete a specific version

Important

Deleting a specific version permanently removes that version. This action cannot be undone.

  1. Click Object Storage in the Storage section of the side menu. A list of your buckets displays.
  2. Click the name of your versioned bucket. A list of the objects it contains appears.
  3. Click more icon next to the object you want to manage, then click Versioning. A side-panel displays, containing the different versions of your object.
  4. Click more icon next to the version you want to delete, then click Delete. A confirmation pop-up appears.
  5. Confirm the deletion to permanently remove the selected version.

Restore an object by removing its delete marker

  1. Click Object Storage in the Storage section of the side menu. A list of your buckets displays.
  2. Click the name of your versioned bucket. A list of the objects it contains appears.
  3. Use the search bar to locate the object you want to restore.
  4. Click more icon next to the object name, then click Versioning. A side-panel displays, containing the different versions of your object.
  5. Delete the delete marker at the top of the versions list.

The version that preceded the delete marker becomes the current version of your object.

How to suspend versioning

Once you enable versioning on a bucket, you can only suspend it rather than disable it completely. When versioning is suspended, existing object versions persist and remain billable.

  1. Click Object Storage in the Storage section of the side menu. A list of your buckets displays.
  2. Click the name of your selected bucket.
  3. Click the Bucket settings tab.
  4. Scroll down and click the toggle toggle icon under Bucket versioning. A pop-up appears.
  5. Type SUSPEND to confirm your action, then click Suspend bucket versioning to proceed.
Important
  • Once versioning is suspended, no new object versions are created. Versions created up to that point remain stored and billable. Uploading an object with the same name as an existing object overwrites it.
  • You cannot suspend versioning on a bucket with object lock enabled.

How to use versioning in combination with lifecycle rules

Lifecycle rules can target non-current versions and delete markers to automatically expire or transition them, which is the main lever to control storage costs on a versioned bucket. Refer to the lifecycle rules documentation for more information.

No Results