How do I restore deleted files in S3?

0

I mistakenly deleted files from my 'version enabled' S3 bucket. I went thru the steps offered by 'Support':

  1. Open the Amazon S3 console.
  2. From the list of buckets, open the bucket of the deleted object.
  3. Navigate to the folder of the deleted object.
  4. Turn on List versions.
  5. In the search bar, enter the name of the deleted object.
  6. Select the previous version of the object (the actual object rather than the delete marker). Choose Actions, and then choose Download. However, it just shows "0 matches". I am the owner of the bucket, but don't know if 'have permissions to s3:GetObjectVersion' - or how to get those 'permissions'.
질문됨 2년 전22291회 조회
3개 답변
1

I tried experimenting a bit and here are a few possibilities I could think of

  1. You might have enabled versioning after the file was uploaded in which case the objects before the versioning was enabled would not have versions. So if you have deleted the object then there is no version to retrieve

Assuming the versioning was enabled before the object was uploaded
2. Did you provide the exact object name? Remember the object name is case sensitive and so you must provide the exact object name
3. Is the bucket too big to manually find it instead of search? There could be two listings. One with the delete marker and then another, the actual version of the object. If you delete the one with delete marker again, then you will see the object in search
4. You might have deleted the object first. Then if you list down the objects, it will show two objects with the same name. One is the version and the other with delete marker. If you delete these two again then you cannot recover the object
5. Go to bucket permissions and check if 'ACLs are disabled. All objects in this bucket are owned by this account' appears. If it does then you have the permissions

답변함 2년 전
  • I believe the enable versioning was enabled before objects were uploaded; I used the exact object name to search with; bucket's not too big; only deleted them once; I as owner are the only one authorized with full permissions. Thanks for going through these.

0

AWS introduced Versioning-enabled buckets a while ago to help you recover objects from accidental deletion or overwrite. Prior to this feature being introduced there was no way to recover a deleted file.

NOTE: By default, S3 Versioning is disabled on buckets, and you must explicitly enable it to protect files from accidental deletes or updates

AWS
답변함 2년 전
  • As stated, I deleted files "from my 'version enabled' S3 bucket." Therefore, should I not be able to restore them?

0

If your goal was to restore object into bucket, you don't need to download (and reupload it) but you could simply remove the delete marker as instructed in https://repost.aws/knowledge-center/s3-undelete-configuration

profile picture
전문가
Kallu
답변함 2달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠