# Snapshot and restore API question

**URL:** https://discuss.elastic.co/t/snapshot-and-restore-api-question/194363
**Category:** Elasticsearch
**Created:** [August 8, 2019, 6:51am UTC](https://discuss.elastic.co/t/snapshot-and-restore-api-question/194363 "2019-08-08T06:51:07Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![mmk1995](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@mmk1995](https://discuss.elastic.co/u/mmk1995)
#### Post date: [August 8, 2019, 6:51am UTC](https://discuss.elastic.co/t/snapshot-and-restore-api-question/194363/1 "2019-08-08T06:51:07Z")

</div>

Hi all,

Is there a best way to restore an index like restoring a relational database?  
As I know, in Oracle, restoring a backup is overwriting the existing database and replace with the backup,  
and the behavior of \_restore API cannot overwrite the index since it will warn "an open index with same name already exists in the cluster", so I have to define "rename\_pattern" and "rename\_replacement".  
Is there a best way to restore an index like restoring a relational database?

Thanks in advance

---

<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: [August 8, 2019, 8:26am UTC](https://discuss.elastic.co/t/snapshot-and-restore-api-question/194363/2 "2019-08-08T08:26:45Z")

</div>

You can close or delete the index before restoring from a snapshot, or else you can restore to a new name and use an alias to redirect traffic to the new index.

---

<div class="post-metadata">

### Author: ![mmk1995](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@mmk1995](https://discuss.elastic.co/u/mmk1995)
#### Post date: [August 8, 2019, 8:34am UTC](https://discuss.elastic.co/t/snapshot-and-restore-api-question/194363/3 "2019-08-08T08:34:18Z")

</div>

thanks for replying,

I would like to ask, what if I close the index and restore a snapshot using that index,  
after that can I open the index again or the index is already replaced by the snapshot?

---

<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: [August 8, 2019, 8:48am UTC](https://discuss.elastic.co/t/snapshot-and-restore-api-question/194363/4 "2019-08-08T08:48:00Z")

</div>

Yes that's correct, the index is replaced.

---

<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: [September 5, 2019, 8:48am UTC](https://discuss.elastic.co/t/snapshot-and-restore-api-question/194363/5 "2019-09-05T08:48:02Z")

</div>

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