Versioning is a means of keeping multiple variants of an object in the same bucket. You can use versioning to preserve, retrieve, and restore every version of every object stored in your Amazon S3 bucket. With versioning, you can easily recover from both unintended user actions and application failures. When you enable versioning for a bucket, if Amazon S3 receives multiple write requests for the same object simultaneously, it stores all of the objects. In this guide, we will see how to do that.

In our previous guide, we have created a s3 bucket and added some files in it.

Now if we have a newer version of these files, we can upload the newer files to the same bucket without removing the old files with the help of versioning. First you have to go to bucket properties and enable versioning

Click on the edit button, enable it and save the changes

Now when you go to the objects tab, you can see the version ID column.

We will now add the new version of files to the same bucket. If you need to know how to add files to a bucket, you can check this article

After that, we can go to the objects tab and see if the files that we have uploaded are in the bucket

As you can see in the above screenshot, it now lists the old and new versions of files that we have uploaded and you can see that the same file now has 2 different version IDs. The version ID of the old files are showing as “null” because we have enabled versioning of this bucket when the old files are already there in the bucket.

If you need to delete a file, you can see the version id of the file that you are going to delete in the delete window

 

The following two tabs change content below.
Ruwantha Nissanka is a Professional Cyber Security Engineer from Sri lanka with having a demonstrated history of providing cyber security services for multiple organizations in Sri Lanka. He is a positive person who wants to believe the best in others and he likes to help, encourage people and make them feel good.