# Behaviour when restoring over closed indicies

**URL:** <https://discuss.elastic.co/t/behaviour-when-restoring-over-closed-indicies/130087>\
**Category:** Elasticsearch\
**Created:** [May 1, 2018, 4:08am UTC](https://discuss.elastic.co/t/behaviour-when-restoring-over-closed-indicies/130087 "2018-05-01T04:08:50Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![hreidmar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hreidmar/32/30638_2.png) [@hreidmar](https://discuss.elastic.co/u/hreidmar)\
**Post date:** [May 1, 2018, 4:08am UTC](https://discuss.elastic.co/t/behaviour-when-restoring-over-closed-indicies/130087/1 "2018-05-01T04:08:51Z")

</div>

I'm looking to understand the behaviour of Elasticsearch snapshot restore under differing circumstances. Try as I might I've been unable to find concrete answers.

- I have two identical elastic search clusters. One is the primary and one is the standby.
- I regularly take snapshots of the primary cluster and they are stored in a repo on an NFS share.
- I restore a snapshot from the primary to the standby.
- I restore the snapshot from the primary on the standby again a day later .. or even a month later.
- I restore multiple times by closing the indices.

Questions:

1. When I restore am I only getting the latest changes from the snapshot? It would seem the restore is much quicker the second time.
2. How common is this practice and are there any edge cases I should know about?
3. What happens if an index has changed since the last restore is it completely replaced or are only parts of it?
4. What happens if the standby cluster has indices or objects in indices that no longer exist in the newest snapshot. Are they deleted and rewritten? Are only the files that don't exist in the snapshot removed? Are any objects or indices ever removed in a restore?
5. In general how are diffs / conflicts handled in the restore process?

Thank you for any information you can provide.

---

<div class="post-metadata">

**Author:** ![Glen\_Smith](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/glen_smith/32/111656_2.png) [@Glen\_Smith](https://discuss.elastic.co/u/Glen_Smith)\
**Post date:** [May 5, 2018, 5:17am UTC](https://discuss.elastic.co/t/behaviour-when-restoring-over-closed-indicies/130087/2 "2018-05-05T05:17:55Z")

</div>

Though it's quite old now (4 years!), this blog post is an excellent way to understand the fundamentals beneath snapshot/restore.

> **[Snapshot and Restore
	  	 | Elastic](https://www.elastic.co/blog/found-elasticsearch-snapshot-and-restore)**
>
> Let's take a closer look at Elasticsearch's snapshot and restore module and the files used to store snapshots, exemplified with snapshots on S3.

  
Please review and follow up if you find any of your questions still unanswered.

---

<div class="post-metadata">

**Author:** ![hreidmar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hreidmar/32/30638_2.png) [@hreidmar](https://discuss.elastic.co/u/hreidmar)\
**Post date:** [May 5, 2018, 4:26pm UTC](https://discuss.elastic.co/t/behaviour-when-restoring-over-closed-indicies/130087/3 "2018-05-05T16:26:43Z")

</div>

This article is helpful and i have had a look over it. It covers alot about repeated snapshot use. it only very lightly touches the topic of restoring over existing indices where it says that they must be closed. So it doesn't answer my questions primarily about restore above.

When I restore over closed indices that are either out of date or that have changed all together into a new cluster what happens to objects or indexes that are in the cluster but not the snapshot?

Is there ever a case where I restore a snapshot over closed indices and I end up with an index that is not representative of the original snapshot?

Mostly I need to understand.. when a cluster and a "standby cluster" diverge in unexpected ways like adding or removing indexes or objects how are all of those diffs resolved.

---

<div class="post-metadata">

**Author:** ![Glen\_Smith](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/glen_smith/32/111656_2.png) [@Glen\_Smith](https://discuss.elastic.co/u/Glen_Smith)\
**Post date:** [May 9, 2018, 3:46am UTC](https://discuss.elastic.co/t/behaviour-when-restoring-over-closed-indicies/130087/4 "2018-05-09T03:46:52Z")

</div>

When you successfully restore an index from a snapshot, the state of the index after the restore is that it contains exactly the segments that were in the snapshot - no more, no less.  
If there are segments on disk in the cluster that are part of the (closed) index of the same name that are not part of the named snapshot, they will no longer exist after the restore.  
If there are segments on disk in the cluster that are part of the (closed) index of the same name that _are_ part of the named snapshot, they _will_ exist after the restore - without needing to have been copied again.  
For this reason, we frequently refer to a snapshot as a "restore point".

I hope this helps!

---

<div class="post-metadata">

**Author:** ![hreidmar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hreidmar/32/30638_2.png) [@hreidmar](https://discuss.elastic.co/u/hreidmar)\
**Post date:** [May 16, 2018, 12:28am UTC](https://discuss.elastic.co/t/behaviour-when-restoring-over-closed-indicies/130087/5 "2018-05-16T00:28:46Z")

</div>

Glen,  
Thank you so much for clarifying this. This is exactly the disambiguation i needed.

---

<div class="post-metadata">

**Author:** ![Glen\_Smith](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/glen_smith/32/111656_2.png) [@Glen\_Smith](https://discuss.elastic.co/u/Glen_Smith)\
**Post date:** [May 23, 2018, 10:04pm UTC](https://discuss.elastic.co/t/behaviour-when-restoring-over-closed-indicies/130087/6 "2018-05-23T22:04:36Z")

</div>

Glad it was what you were looking for!

---

<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:** [June 20, 2018, 10:04pm UTC](https://discuss.elastic.co/t/behaviour-when-restoring-over-closed-indicies/130087/7 "2018-06-20T22:04:37Z")

</div>

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