Welcome to the upcoming version of the MinIO Documentation! The content on this page is under active development and may change at any time. If you can't find what you're looking for, check our legacy documentation. Thank you for your patience.

mc version

Description

The mc version command enables or disables bucket versioning.

Object Locking Enables Bucket Versioning

While bucket versioning is disabled by default, configuring object locking on a bucket or an object in that bucket automatically enables versioning for the bucket. See mc lock for more information on configuring object locking.

Bucket Versioning Requires Erasure Coding

Bucket versioning requires that the MinIO deployment supports erasure coding. See <erasure coding link> for more information.

Bucket Versioning with Existing Data

Enabling bucket versioning on a bucket with existing data immediately applies a versioning ID to any unversioned object.

Disabling bucket versioning on a bucket with existing versioned data does not remove any versioned objects. Applications can continue to access versioned data after disabling bucket versioning. Use mc rm --versions ALIAS/BUCKET/OBJECT to delete an object and all its versions.

Common Operations

Enable Bucket Versioning

Use mc version enable to enable versioning on a bucket:

mc version enable ALIAS/PATH
  • Replace ALIAS with the alias of a configured S3-compatible host.

  • Replace PATH with the bucket on which to enable versioning.

Disable Bucket Versioning

Use mc version disable to disable versioning on a bucket:

mc version disable ALIAS/PATH
  • Replace ALIAS with the alias of a configured S3-compatible host.

  • Replace PATH with the bucket on which to disable versioning.

Get Bucket Versioning Status

Use mc version info to enable versioning on a bucket:

mc version info ALIAS/PATH
  • Replace ALIAS with the alias of a configured S3-compatible host.

  • Replace PATH with the bucket on which to retrieve the versioning status.

Syntax

mc version COMMAND

version supports the following commands:

mc version enable

Enables bucket versioning on the specified bucket.

The command has the following syntax:

mc version enable TARGET

The command accepts the following arguments:

TARGET

Required The full path to the bucket on which to enable bucket versioning. Specify the alias of a configured S3-compatible service as the prefix to the TARGET path. For example:

mc version enable play/mybucket
mc version disable

Disables bucket versioning on the specified bucket.

The command has the following syntax:

mc version disable TARGET

The command accepts the following arguments:

TARGET

Required The full path to the bucket on which to disable bucket versioning. Specify the alias of a configured S3-compatible service as the prefix to the TARGET path. For example:

mc version disable play/mybucket
mc version info

Retrieves the bucket versioning status for the specified bucket.

The command has the following syntax:

mc version info TARGET

The command accepts the following arguments:

TARGET

Required The full path to the bucket on which to retrieve the bucket versioning status. Specify the alias of a configured S3-compatible service as the prefix to the TARGET path. For example:

mc version info play/mybucket