# Delete and restore snapshot on AWS s3

**URL:** <https://discuss.elastic.co/t/delete-and-restore-snapshot-on-aws-s3/169394>\
**Category:** Elasticsearch\
**Created:** [February 21, 2019, 10:51am UTC](https://discuss.elastic.co/t/delete-and-restore-snapshot-on-aws-s3/169394 "2019-02-21T10:51:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phandora](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/phandora/32/46108_2.png) [@Phandora](https://discuss.elastic.co/u/Phandora)\
**Post date:** [February 21, 2019, 10:51am UTC](https://discuss.elastic.co/t/delete-and-restore-snapshot-on-aws-s3/169394/1 "2019-02-21T10:51:30Z")

</div>

Hi,

I'd like to understand how delete and restore functions work. I thought if you delete a snapshot from S3, you will not be able to restore it later, but I'm having some weird behaviour. For example, if I code the following lines from terminal:

// curl -XDELETE localhost:9200/\_snapshot/repository-s3/snap1  
// curl -XGET 'localhost:9200/\_snapshot/repository-s3/\_all?pretty=true'  
// curl -XPOST localhost:9200/\_snapshot/repository-s3/snap1  
// curl -XGET 'localhost:9200/\_snapshot/repository-s3/\_all?pretty=true'

After deleting snap1, it doesnt shows when I made the GET call and it doesn't appear either on AWS s3, but after restoring snap1, it shows again on terminal and on AWS s3 too.

I thought the restore call only worked to restore specified snapshot to the cluster, but not in AWS s3 repository.

Does it make any sense?

Any help appreciated.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [February 21, 2019, 10:35pm UTC](https://discuss.elastic.co/t/delete-and-restore-snapshot-on-aws-s3/169394/2 "2019-02-21T22:35:29Z")

</div>

> [@Phandora](#):
>
> `curl -XPOST localhost:9200/_snapshot/repository-s3/snap1`

You seem to be describing this step as "restore", but it isn't. I think this is making a new snapshot called `snap1`. A restore looks like this:

```auto
POST /_snapshot/my_backup/snapshot_1/_restore

```

Note the `/_restore` on the end.

---

<div class="post-metadata">

**Author:** ![Phandora](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/phandora/32/46108_2.png) [@Phandora](https://discuss.elastic.co/u/Phandora)\
**Post date:** [February 21, 2019, 11:12pm UTC](https://discuss.elastic.co/t/delete-and-restore-snapshot-on-aws-s3/169394/3 "2019-02-21T23:12:06Z")

</div>

Thanks David for the provided explanation. I thought "PUT" and "POST" make the different between creating a new snapshot and restoring it, but I was wrong, It works exactly like you said, I have already checked it.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 7, 2019, 11:16pm UTC](https://discuss.elastic.co/t/delete-and-restore-snapshot-on-aws-s3/169394/4 "2019-03-07T23:16:48Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
