# Elasticsearch snapshot how it works

**URL:** <https://discuss.elastic.co/t/elasticsearch-snapshot-how-it-works/314711>\
**Category:** Elasticsearch\
**Tags:** snapshot-and-restore\
**Created:** [September 19, 2022, 4:23pm UTC](https://discuss.elastic.co/t/elasticsearch-snapshot-how-it-works/314711 "2022-09-19T16:23:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![xalastoi](https://avatars.discourse-cdn.com/v4/letter/x/53a042/32.png) [@xalastoi](https://discuss.elastic.co/u/xalastoi)\
**Post date:** [September 19, 2022, 4:23pm UTC](https://discuss.elastic.co/t/elasticsearch-snapshot-how-it-works/314711/1 "2022-09-19T16:23:13Z")

</div>

i want to understand how snapshot works in elasticsearch case1 snapshots are taken every day and snapshots older than 1 month are deleted I have an index cities and for example there are 3 documents { barcelona, ​​madrid, urumqi} and, for example, I deleted the barcelona document from the index, it turns out that if a month passes and the last snapshot in which this index was deleted, then I can no longer recover this document?

case2 I have an elasticsearch cluster and a fairly large number of indexes, the rotation is 3 months, if, for example, a couple of indexes change or all are deleted, then if I restore from a snapshot that was taken 3 months ago, will my cluster be fully restored 3 on months ago data? will snapshot process rewrite all data or not?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [September 19, 2022, 4:49pm UTC](https://discuss.elastic.co/t/elasticsearch-snapshot-how-it-works/314711/2 "2022-09-19T16:49:11Z")

</div>

> [@xalastoi](#):
>
> i want to understand how snapshot works in elasticsearch case1 snapshots are taken every day and snapshots older than 1 month are deleted I have an index cities and for example there are 3 documents { barcelona, ​​madrid, urumqi} and, for example, I deleted the barcelona document from the index, it turns out that if a month passes and the last snapshot in which this index was deleted, then I can no longer recover this document?

If the oldest snapshot you have left was taken after the barcelona document was deleted this document can no longer be restored.

> [@xalastoi](#):
>
> case2 I have an elasticsearch cluster and a fairly large number of indexes, the rotation is 3 months, if, for example, a couple of indexes change or all are deleted, then if I restore from a snapshot that was taken 3 months ago, will my cluster be fully restored 3 on months ago data? will snapshot process rewrite all data or not?

The snapshot captures a point in time. If you restore an index from a snapshot that was taken 3 months ago, any changes made since will no longer be available.

---

<div class="post-metadata">

**Author:** ![xalastoi](https://avatars.discourse-cdn.com/v4/letter/x/53a042/32.png) [@xalastoi](https://discuss.elastic.co/u/xalastoi)\
**Post date:** [September 20, 2022, 8:17am UTC](https://discuss.elastic.co/t/elasticsearch-snapshot-how-it-works/314711/3 "2022-09-20T08:17:32Z")

</div>

> [@Christian\_Dahlqvist](#):
>
> The snapshot captures a point in time. If you restore an index from a snapshot that was taken 3 months ago, any changes made since will no longer be available.

so i restore my index with old content, and all new writes will be deleted right? sorry for my stupidness

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [September 20, 2022, 8:38am UTC](https://discuss.elastic.co/t/elasticsearch-snapshot-how-it-works/314711/4 "2022-09-20T08:38:17Z")

</div>

Yes.

---

<div class="post-metadata">

**Author:** ![cheshirecat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cheshirecat/32/109532_2.png) [@cheshirecat](https://discuss.elastic.co/u/cheshirecat)\
**Post date:** [September 20, 2022, 8:39am UTC](https://discuss.elastic.co/t/elasticsearch-snapshot-how-it-works/314711/5 "2022-09-20T08:39:29Z")

</div>

> [@xalastoi](#):
>
> so i restore my index with old content, and all new writes will be deleted right? sorry for my stupidness

This is how backup works. Not only for Elasticsearch.

---

<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:** [October 18, 2022, 8:40am UTC](https://discuss.elastic.co/t/elasticsearch-snapshot-how-it-works/314711/6 "2022-10-18T08:40:14Z")

</div>

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