1

The AWS S3 API lets you enable versioning on a bucket using the aws s3api put-bucket-versioning command. Future objects written to that bucket are versioned, but existing objects are not.

But is there a quick way to enable versioning on individual, pre-existing objects in that bucket? It seems that the only naive solution is to make a copy of every object, delete the originals, then make a copy of the copies back over the original keys, which seems extremely inefficient.

I noticed there is a similar question here from 4 years ago without a resolution. Unfortunately, unlike the author of that question, I have about 1.3 PB of data in my bucket and the naive solution of copying twice might take a while.

1 Answer 1

1

My understanding is once you enable versioning on the bucket all versions will be kept in future. You cannot retrospectively upload older objects.

You are likely correct that if you want versions of existing objects you will have to overwrite them with the older object, then the newer object. Yes, it's inefficient, but it's also an extremely rare requirements so I'm not surprised S3 can't cater for it.

I once had a situation where objects in our bucket were owned by a service provider, and we needed to own them. I had to get read access to the objects then copy objects over themselves with the account as the owner. At least that what I recall doing, it was a while ago.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .