amazon-web-services – How to Enable Amazon S3 Versioning for Existing Objects

amazon s3amazon-web-servicesversion control

All the information that I have read on the AWS S3 Object Versioning specifically mentions this:

Objects stored in your bucket before you set the versioning state have a version ID of null. When you enable versioning, existing objects in your bucket do not change. What changes is how Amazon S3 handles the objects in future requests. The topics in this section explain various object operations in a versioning-enabled bucket.

source

I currently have about 2 TB (370K objects) of data in a bucket. My understanding is that if I turn on versioning now, then future objects will be versioned. My question: What about existing objects? Am I stuck without them being non-versioned or is there a way to version them without downloading/reuploading them? I've not found any info while doing Google Fu so wanted to ping the collective here.

Thanks.

Best Answer

Sorry man but you're stuck.

The versioning must be enabled to get access to previous versions.

With versioning disabled or with versioning suspended, you can not retrieve changelogs of any sort. The file is simply overwritten.

If a null version already exists in a bucket, the null version is overwritten, as shown in the following figure.

version diagram
(source: amazon.com)

Having no versioning ever enabled follows the same policy. But looks more like this:

no versioning
(source: amazon.com)

Where the object with version ID null simply continues to be overwritten. If AWS had versioning set up by default they would probably run out of space.

Update: the items already in the bucket will immediately start versioning when you enable it.