- Newest
- Most votes
- Most comments
Hello.
If the bucket does not have versioning enabled as mentioned in re:Post Agent's answer, you will not be able to restore it.
https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-managing-bucket-object-versioning.html
If versioning was originally enabled on the bucket, you can restore it using the steps in the documentation below, but if versioning was not enabled before the object was deleted, it cannot be restored.
https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-restoring-bucket-object-versions.html
I apologize, but I'm afraid recovering accidentally deleted files from a Lightsail storage bucket may not be possible unless certain precautions were in place beforehand. Here's what you need to know:
-
If versioning was not enabled on the bucket before the deletion occurred, there is unfortunately no way to recover the deleted files. Amazon S3 (which Lightsail storage buckets are based on) does not keep hidden copies of data you've deleted.
-
If versioning was enabled on the bucket prior to deletion, there might be a chance to recover the files. In this case, when objects are deleted, they are not permanently removed but rather marked with a delete marker. You would need to check if you can see previous versions of the files by enabling "show versions" in the bucket interface.
-
Even if versioning was enabled, if someone used the "empty bucket" action or permanently deleted versioned objects, recovery would not be possible.
-
For future reference, to protect against accidental deletions, you can:
- Enable versioning on your buckets
- Use S3 Object Lock (if available for Lightsail buckets)
- Set up regular backups using AWS Backup or a similar service
If versioning was enabled and the files were not permanently deleted, you may be able to restore them by removing the delete markers. However, this process can be complex and may require using the AWS CLI or SDK.
Given the critical nature of data recovery, I recommend contacting AWS Support directly for personalized assistance. They may be able to provide more specific guidance based on your account's configuration and the exact circumstances of the deletion.
For the future, it's crucial to implement backup strategies and enable versioning on important buckets to prevent data loss in similar situations.
Sources
Is there a way to restore a folder completely deleted from s3? | AWS re:Post
Retrieve deleted S3 files? | AWS re:Post
Recover a recent deleted Bucket | AWS re:Post
Retrieve an Amazon S3 object that was deleted | AWS re:Post
Hi Riku,
Thank you for sharing this. We have connected the storage bucket to our WordPress WooCommerce website, where product images are stored. Periodically, we remove products, and as part of this process, we have enabled a function to automatically delete the associated product images. However, this function also deleted the entire product image directory within the storage bucket.
Hi,
Please open a support case with AWS with relevant details and we would be happy to assist you. If you have a basic (free) support plan, you can create a support case with a general question under Accounts and billing category.
Thanks!
I have submitted the case. But they asked me to submit a question here.
Relevant content
asked 4 years ago
- AWS OFFICIALUpdated 2 years ago

Hi Riku,
I have enabled the versioning. I'm not aware of how to get version ID to run this command "aws s3api copy-object --copy-source "BucketName/ObjectKey?versionId=VersionId" --key ObjectKey --bucket BucketName " Could you please help me to find it?
There is no point in enabling versioning after the object has been deleted. Did you have versioning settings enabled before the object was deleted?
Yes, it has been enabled before deleting the files.
If so, you can restore from the console instead of the AWS CLI as described in the document below. https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-restoring-bucket-object-versions.html#restore-previous-object-version-lightsail-console
In the case of AWS CLI, you can obtain it by doing the following. https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3api/list-object-versions.html
By the way, did you delete it from the console? In that case, all older versions will also be deleted and cannot be restored even if versioning is enabled. It is noted in the notes when restoring the object.
https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-deleting-bucket-objects.html#deleting-objects-lightsail-console