Manage Versioning in SCS3
When versioning is enabled, SCS3 will keep track of all changes to an object, allowing you to restore previous versions if needed.
This guide explains how to manage versioning in SCS3 using two S3-compatible clients: AWS CLI and Rclone.
Prerequisites
- Obtain S3 keys through Switch Cloud Portal. Remember that each project has its own unique keys
- AWS CLI (at least version 2.13) installed and configured with your S3 credentials. For more information about setting up AWS CLI with Switch Cloud S3 credentials visit User Authentication.
Check Versioning Status
To check versioning status on the bucket, run the following command:
Bucket versioning status (possible values:Enabled
, Suspended
):
If a bucket is unversioned the above command will give no output.
Enable Versioning
Important
Enabling versioning on a bucket does not apply versioning to existing objects. These objects remain unversioned but accessible. Versioning applies to new objects and to modifications or deletions of existing objects, which will create new versions. It is recommended to enable versioning at the time of bucket creation to ensure consistent versioning behavior from the start.
Suspend Versioning
To suspend versioning on the bucket, run the following command (no output, if successful):
List Object Versions
To list objects with all their versions, run the following command:
Example output
{
"Versions": [
{
"ETag": "\"524c2b5dda474601d0d541e56b0b74fe\"",
"Size": 4679,
"StorageClass": "STANDARD",
"Key": "empty.txt",
"VersionId": ".7TCd9al7KDS9qLgoPogKug1xXMwE3m",
"IsLatest": true,
"LastModified": "2025-03-06T12:15:19.581000+00:00",
"Owner": {
"DisplayName": "Display_Name",
"ID": "01951932-8144-7746-9308-eaf805667866"
}
},
{
"ETag": "\"70b69e9cf45c4043915d97a0d2c92a45\"",
"Size": 26,
"StorageClass": "STANDARD",
"Key": "empty.txt",
"VersionId": "-jTBIFZUOJgr.osgSmiVyZYQBQseCp8",
"IsLatest": false,
"LastModified": "2025-03-06T12:14:46.031000+00:00",
"Owner": {
"DisplayName": "Display_Name",
"ID": "01951932-8144-7746-9308-eaf805667866"
}
},
{
"ETag": "\"d41d8cd98f00b204e9800998ecf8427e\"",
"Size": 0,
"StorageClass": "STANDARD",
"Key": "empty.txt",
"VersionId": "6XSJkis5GtARQDS-K2-5wdjYuSRGo24",
"IsLatest": false,
"LastModified": "2025-03-06T12:14:18.462000+00:00",
"Owner": {
"DisplayName": "Display_Name",
"ID": "01951932-8144-7746-9308-eaf805667866"
}
}
],
"RequestCharged": null,
"Prefix": "empty.txt"
}
You may list all versions of all objects in a bucket by running:
Example output
Important
Note that Rclone displays versions differently than AWS CLI. Versions' names are created by inserting timestamp between file name and its extension.
Retrieve a Specific Version of an Object
To retrieve a specific version of an object, run the following command:
To retrieve a specific version of an object, run the following command (no output, if successful):
Important
To specify <object_key>
use the exact version key as Rclone displays it, for example: empty-v2025-03-06-121446-031.txt
Delete a Specific Version of an Object
To delete a specific version of an object, run the following command:
Warning
Deleting a specific object version permanently removes that version from the bucket. This action is irreversible.
Useful Links
For more detailed information about S3 versioning management, refer to the official documentation: