Search code examples
amazon-web-servicesamazon-s3version

rolling back version on whole s3 bucket


I have an s3 bucket on aws with versioning enabled. I need to "rollback" to the previous version. Not file by file but the whole bucket. Is there any software i can use? or any command on the console that i can run? it's an emergency and time sensitive.

Thanks you!


Solution

  • There is no concept of "rollback to the previous version" for a bucket.

    Each object maintains a version history, and each historical version of each object is maintained and accessible.

    If you wish to abandon the most recent version of each object, you would need to write a script/program that would:

    • Obtain a list of all objects
    • For each object:
      • Obtain a list of versions
      • Delete the most recent version

    The prior version of each object would then become the current version.

    Alternatively, you could obtain the previous version of each object without removing the current version. This would involve a similar script/program, without the delete step.