# Why cannot restore index from snapshot if an open index with same name exists in the cluster?

**URL:** https://discuss.elastic.co/t/why-cannot-restore-index-from-snapshot-if-an-open-index-with-same-name-exists-in-the-cluster/258374
**Category:** Elasticsearch
**Created:** [December 11, 2020, 6:34am UTC](https://discuss.elastic.co/t/why-cannot-restore-index-from-snapshot-if-an-open-index-with-same-name-exists-in-the-cluster/258374 "2020-12-11T06:34:15Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Simolx](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simolx/32/36174_2.png) [@Simolx](https://discuss.elastic.co/u/Simolx)
#### Post date: [December 11, 2020, 6:34am UTC](https://discuss.elastic.co/t/why-cannot-restore-index-from-snapshot-if-an-open-index-with-same-name-exists-in-the-cluster/258374/1 "2020-12-11T06:34:16Z")

</div>

Why cannot restore index from snapshot if an open index with same name exists in the cluster?

In Elasticsearch Source Code `server/src/main/java/org/elasticsearch/snapshots/RestoreService.java` method ` validateExistingIndex`, there is a `TODO` that `// TODO: Enable restore for open indices`.  
If I want to create snapshot incrementally from a cluster, and only restore index in another cluster, can I change the index exist checking?

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [December 11, 2020, 6:37am UTC](https://discuss.elastic.co/t/why-cannot-restore-index-from-snapshot-if-an-open-index-with-same-name-exists-in-the-cluster/258374/2 "2020-12-11T06:37:30Z")

</div>

Are you looking at syncing continuously 2 clusters? If it's the case, I'd look at:

> **[Cross-cluster replication | Elasticsearch Reference \[7.10\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/xpack-ccr.html)**

I think it requires a platinum license. But you can activate a trial super easily from Kibana.

---

<div class="post-metadata">

### Author: ![Simolx](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simolx/32/36174_2.png) [@Simolx](https://discuss.elastic.co/u/Simolx)
#### Post date: [December 11, 2020, 6:44am UTC](https://discuss.elastic.co/t/why-cannot-restore-index-from-snapshot-if-an-open-index-with-same-name-exists-in-the-cluster/258374/3 "2020-12-11T06:44:33Z")

</div>

Thank you very much. I also want to know why I need to close the exists index before restore on it.

---

<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: [December 11, 2020, 8:55am UTC](https://discuss.elastic.co/t/why-cannot-restore-index-from-snapshot-if-an-open-index-with-same-name-exists-in-the-cluster/258374/4 "2020-12-11T08:55:47Z")

</div>

The answer is the comment you quoted:

> [@Simolx](#):
>
> `// TODO: Enable restore for open indices` .

i.e. it's not done yet 😉

Restoring into an open index would be really complicated to implement, because the restore needs to replace the underlying files. Doing that while closed is simpler since those files aren't in use, but if the index were open then we can't simply replace them. Also we'd need to do the restore on all the replicas at the same time, rather than today's process which only happens on the primary.

---

<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: [January 8, 2021, 8:55am UTC](https://discuss.elastic.co/t/why-cannot-restore-index-from-snapshot-if-an-open-index-with-same-name-exists-in-the-cluster/258374/5 "2021-01-08T08:55:53Z")

</div>

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