How to recover deleted files on Amazon S3?

This was my question a few days ago, but I also have an answer which I’d like to share.

One of the neat things that AWS S3 offers is versioning. Every time a file is updated (or deleted), the old version of that file is kept around.

While that does increase storage costs, it also allows for files to be undeleted in case of accidental deletion.

The process is somewhat complicated, so I wrote up an entire blog post covering the topic:

https://www.dmuth.org/node/1472/how-undelete-files-amazon-s3

Enjoy! Feel free to let me know in the replies how it works out.

– Doug

2 Likes

Thanks for the writeup @dmuth!

Versioning is definitely very powerful. For any folks who would like to enable it on their bucket, keep in mind that the objects retained as versions will count against your storage. Lifecycle rules on the bucket can be used to regulate this, however.

2 Likes