# Is snapshot restore incremental？

**URL:** <https://discuss.elastic.co/t/is-snapshot-restore-incremental/298474>\
**Category:** Elasticsearch\
**Tags:** snapshot-and-restore\
**Created:** [March 1, 2022, 7:21am UTC](https://discuss.elastic.co/t/is-snapshot-restore-incremental/298474 "2022-03-01T07:21:47Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![casterQ](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/casterq/32/93257_2.png) [@casterQ](https://discuss.elastic.co/u/casterQ)\
**Post date:** [March 1, 2022, 7:21am UTC](https://discuss.elastic.co/t/is-snapshot-restore-incremental/298474/1 "2022-03-01T07:21:47Z")

</div>

As we know, the snapshot process is incremental, so we can take snapshots frequently and It will be very fast after the first time。  
My question is how restore work, When I restore snapshots in other clusters, is it incremental? and can I restore frequently？  
thanks

---

<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:** [March 1, 2022, 8:18am UTC](https://discuss.elastic.co/t/is-snapshot-restore-incremental/298474/2 "2022-03-01T08:18:35Z")

</div>

> [@casterQ](#):
>
> As we know, the snapshot process is incremental, so we can take snapshots frequently and It will be very fast after the first time

Each snapshot is a full snapshot. The incremental aspect in it is that segments that have already been snapshotted are not copied again, so only new segments are copied after the first snapshot.

When you restore an index from a snapshot it is a complete index, not an increment.

---

<div class="post-metadata">

**Author:** ![casterQ](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/casterq/32/93257_2.png) [@casterQ](https://discuss.elastic.co/u/casterQ)\
**Post date:** [March 1, 2022, 8:21am UTC](https://discuss.elastic.co/t/is-snapshot-restore-incremental/298474/3 "2022-03-01T08:21:35Z")

</div>

So I want to incrementally synchronize indexes to other clusters every day，snapshot won't speed up this speed after the first time

---

<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:** [March 1, 2022, 8:33am UTC](https://discuss.elastic.co/t/is-snapshot-restore-incremental/298474/4 "2022-03-01T08:33:25Z")

</div>

They will. It's using an incremental method to build full backups at each run.

---

<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:** [March 1, 2022, 8:36am UTC](https://discuss.elastic.co/t/is-snapshot-restore-incremental/298474/5 "2022-03-01T08:36:29Z")

</div>

Creating snapshots will speed up but you will need to restore complete indices.

---

<div class="post-metadata">

**Author:** ![casterQ](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/casterq/32/93257_2.png) [@casterQ](https://discuss.elastic.co/u/casterQ)\
**Post date:** [March 1, 2022, 8:43am UTC](https://discuss.elastic.co/t/is-snapshot-restore-incremental/298474/6 "2022-03-01T08:43:10Z")

</div>

You mean the second time I restore an index to another cluster will be faster than the first time?  
What should I do？  
first time，

```auto
POST /_snapshot/my_repository/snapshot_1/_restore
{
  "indices": "index1"
}

```

second time：

```auto
POST index1/_close

```

then：

```auto
POST /_snapshot/my_repository/snapshot_2/_restore
{
  "indices": "index1"
}

```

Suppose the gap between index1 in snapshot\_1 and index1 in snapshot\_2 is small，The second restore will be much faster than the first ?

---

<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:** [March 1, 2022, 8:44am UTC](https://discuss.elastic.co/t/is-snapshot-restore-incremental/298474/7 "2022-03-01T08:44:47Z")

</div>

Restoring will not be faster as the full index will need to be restored.

---

<div class="post-metadata">

**Author:** ![casterQ](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/casterq/32/93257_2.png) [@casterQ](https://discuss.elastic.co/u/casterQ)\
**Post date:** [March 1, 2022, 8:49am UTC](https://discuss.elastic.co/t/is-snapshot-restore-incremental/298474/8 "2022-03-01T08:49:08Z")

</div>

So if I want to incrementally synchronize data between clusters every data , use an incremental fields filter data(such as timestamp) to reindex to another cluster， is a better choice, right?

---

<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:** [March 1, 2022, 8:58am UTC](https://discuss.elastic.co/t/is-snapshot-restore-incremental/298474/9 "2022-03-01T08:58:37Z")

</div>

The best and easiest option is Cross Cluster Replication. But it's under a commercial license.

---

<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:** [March 1, 2022, 9:00am UTC](https://discuss.elastic.co/t/is-snapshot-restore-incremental/298474/10 "2022-03-01T09:00:08Z")

</div>

I don't remember how restore is working behind the scene. I thought that it would "just" restore the missing files and remove the non-needed. 🤷🏽

---

<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:** [March 1, 2022, 9:50am UTC](https://discuss.elastic.co/t/is-snapshot-restore-incremental/298474/11 "2022-03-01T09:50:50Z")

</div>

Yeah that's right, it will re-use any files on disk that match the ones in the snapshot rather than downloading them all again.

---

<div class="post-metadata">

**Author:** ![casterQ](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/casterq/32/93257_2.png) [@casterQ](https://discuss.elastic.co/u/casterQ)\
**Post date:** [March 1, 2022, 9:53am UTC](https://discuss.elastic.co/t/is-snapshot-restore-incremental/298474/13 "2022-03-01T09:53:04Z")

</div>

The second time will be much faster than the first time？as restore is incremental？

---

<div class="post-metadata">

**Author:** ![casterQ](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/casterq/32/93257_2.png) [@casterQ](https://discuss.elastic.co/u/casterQ)\
**Post date:** [March 1, 2022, 11:02am UTC](https://discuss.elastic.co/t/is-snapshot-restore-incremental/298474/14 "2022-03-01T11:02:23Z")

</div>

@DavidTurner @Christian_Dahlqvist @dadoonet  
So do we have a conclusion? A or B  
A. restore is incremental,restore only recover the new segments；  
B. restore is not incremental,restore need to recover the entire index every time。

---

<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:** [March 1, 2022, 12:02pm UTC](https://discuss.elastic.co/t/is-snapshot-restore-incremental/298474/15 "2022-03-01T12:02:23Z")

</div>

I did not know it was possible/safe to restore an index from a snapshot over an existing index. If David says that is possible I would trust him.

---

<div class="post-metadata">

**Author:** ![casterQ](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/casterq/32/93257_2.png) [@casterQ](https://discuss.elastic.co/u/casterQ)\
**Post date:** [March 2, 2022, 7:17am UTC](https://discuss.elastic.co/t/is-snapshot-restore-incremental/298474/17 "2022-03-02T07:17:50Z")

</div>

I did a test and came to a conclusion：  
**restore is incremental**  
And i got the following through the recovery API：The `reused` part is reused  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/2/92b0871c53c84fc3f29ca9267659d4971cc46e2b.png)  
but， i have a new question now：What does `file` means here，I confirm that this is not the number of segments，beacuse this shard has only 9 segments but not 45

---

<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 30, 2022, 7:18am UTC](https://discuss.elastic.co/t/is-snapshot-restore-incremental/298474/18 "2022-03-30T07:18:01Z")

</div>

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