Is there a way to copy an S3 bucket including the versions of objects?
I read that a way to copy a bucket is by using the command line tool with
aws s3 sync s3://<source> s3://<dest>
However, on in the source bucket I had:
while in the synced bucket I have:
As you can see the Version ID is "null". Is there a way to make a 100% identical copy, including the version ID? This would be important for our backups / development server, as our app is relying on the version ID. Edit: If I turn on versioning before the sync I get version Id's different from null. But the version Ids differ from the ones in the original bucket and the goal would be to preserve the version Ids. I also tried the cp
command, it yields the same results. The result described above is also documented here:
If you enable versioning on the target bucket, Amazon S3 generates a unique version ID for the object being copied. This version ID is different from the version ID of the source object. Amazon S3 returns the version ID of the copied object in the x-amz-version-id response header in the response.
If you do not enable versioning or suspend it on the target bucket, the version ID Amazon S3 generates is always null.
So it looks like aws doesn't provide a way to preserve version Ids? If so, is there a workaround or third party software for this?