When versioning is enabled, TOS assigns a unique version ID to each object in a bucket. This ID can be used to restore the object if it is accidentally deleted or overwritten. This topic introduces the operations you can perform after enabling versioning.
Background information
For more information on versioning and how to enable it, see Overview. Notes
After enabling versioning, you can only suspend it. You cannot revert it to the "Disabled" state. When you suspend versioning, existing objects in your bucket do not change.
Viewing a historical object version
When versioning is enabled on your bucket, the objects list displays the latest versions and hides historical versions by default. Follow the steps below to view historical versions.
- In the left navigation pane, click Buckets. In the Buckets list, click the bucket you want to check.
- On the Objects page, toggle the Show versions switch on in the upper-right corner. The list will then display the historical versions.
-
- Click Details in the Actions column of the historical version to view its details, including filename, version ID, and URL.
Permanently deleting an object
To permanently delete an object from a versioning-enabled bucket, you must first toggle the Show versions switch. Follow the steps below to permanently delete an object.
- In the left navigation pane, click Buckets. In the Buckets list, click the bucket you want to manage.
- On the Objects page, toggle the Show versions switch on in the upper-right corner.
warning
Deleting an object from a versioning-enabled or versioning-suspended bucket without enabling Show versions will add a deletion mark to the object rather than deleting it. In other words, the object is still stored in your bucket, but hidden.
- On the Objects page, click ... > Permanently Delete in the Actions column of the object you want to remove.
- In the box that appears, confirm the deletion by clicking Delete.
Permanently deleting a folder
You can delete any folders that are no longer needed. Deleting a folder will also delete its contents. Follow the steps below to permanently delete a folder.
- In the left navigation pane, click Buckets. In the Buckets list, click the bucket you want to manage.
- On the Objects page, toggle the Show versions switch on in the upper-right corner.
warning
Deleting a folder from a versioning-enabled or versioning-suspended bucket without enabling Show versions will add a deletion mark to the folder rather than deleting it. In other words, the folder is still stored in your bucket, but hidden.
- On the Objects page, click Permanently Delete in the Actions column of the folder you want to remove.
- In the box that appears, confirm the deletion by clicking Permanently Delete.
Deleting a deletion mark
Deleting an object from a versioning-enabled or versioning-suspended bucket without enabling Show versions will add a deletion mark to the object rather than deleting it. Follow the steps below to delete a deletion mark.
- In the left navigation pane, click Buckets. In the Buckets list, click the bucket you want to manage.
- On the Objects page, toggle the Show versions switch on in the upper-right corner.
- On the Objects page, click ... > Delete in the Actions column of the deletion mark you want to remove.
- In the box that appears, confirm the deletion by clicking Delete.
warning
Rather than deleting the object, deleting a deletion mark cancels the object deletion operation. To delete the object, see Permanently deleting an object. Downloading a specific object version
Once versioning is enabled, all versions of an object are retained by default. Follow the steps below to download a specific version.
- In the left navigation pane, click Buckets. In the Buckets list, click the bucket you want to manage.
- On the Objects page, toggle the Show versions switch on in the upper-right corner.
- On the Objects page, click Download in the Actions column of the version you want.
Once versioning is enabled, all versions of an object are retained by default. You can restore an object by either deleting the latest version or copying an earlier version. Follow the steps below to restore an object:
tip
We recommend restoring objects by copying their historical versions. Deleting the latest version is an irreversible action, whereas copying the historical version allows you to keep all versions of the object.
Delete the latest version
Copy an earlier version
- In the left navigation pane, click Buckets. In the Buckets list, click the bucket you want to manage.
- On the Objects page, toggle the Show versions switch on in the upper-right corner.
- Click ... > Permanently Delete in the Actions column of the latest version you want to remove.
- In the box that appears, enter Permanently Delete and click Delete.
- Once the latest version has been deleted, the previous version automatically becomes the latest.
You can use the CopyObject API to copy an earlier version of the object to the same bucket. After this process, a new version identical to the historical version is created and becomes the latest version. The previous latest version then becomes a historical version and all object versions are preserved. For instructions, see CopyObject.