# How to takes elasticsearch backup on closed indexes in a clustered environment

**URL:** <https://discuss.elastic.co/t/how-to-takes-elasticsearch-backup-on-closed-indexes-in-a-clustered-environment/190635>\
**Category:** Elasticsearch\
**Created:** [July 16, 2019, 3:07am UTC](https://discuss.elastic.co/t/how-to-takes-elasticsearch-backup-on-closed-indexes-in-a-clustered-environment/190635 "2019-07-16T03:07:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![krishanr](https://avatars.discourse-cdn.com/v4/letter/k/dbc845/32.png) [@krishanr](https://discuss.elastic.co/u/krishanr)\
**Post date:** [July 16, 2019, 3:07am UTC](https://discuss.elastic.co/t/how-to-takes-elasticsearch-backup-on-closed-indexes-in-a-clustered-environment/190635/1 "2019-07-16T03:07:27Z")

</div>

I've configured 3-node clustered ELK nodes and also configured snapshot feature.  
But I need to take a backup of closed indexes.  
Re-open & take a snapshot is not practical. Is there another way to do this?

---

<div class="post-metadata">

**Author:** ![harshbajaj16](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/harshbajaj16/32/44970_2.png) [@harshbajaj16](https://discuss.elastic.co/u/harshbajaj16)\
**Post date:** [July 16, 2019, 4:06am UTC](https://discuss.elastic.co/t/how-to-takes-elasticsearch-backup-on-closed-indexes-in-a-clustered-environment/190635/2 "2019-07-16T04:06:17Z")

</div>

Hi @krishanr,

You can take backup only for open indices not for closed indices.

> [@](#):
>
> Re-open & take a snapshot is not practical. Is there another way to do this?

No, There is no other way to do the same you can take backup before close the indices.

However, There is a temporary solution to achieve the result but i don't know it will work with your environment or not.  
**Temp solution:**  
You can tar'ing up and gzip'ing a closed index and deleting the original directory, then unzip'ing and re-opening the index in ES and that works. I've tried this once in my environment.

Regards,  
Harsh Bajaj

---

<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:** [July 16, 2019, 5:41am UTC](https://discuss.elastic.co/t/how-to-takes-elasticsearch-backup-on-closed-indexes-in-a-clustered-environment/190635/3 "2019-07-16T05:41:51Z")

</div>

> [@harshbajaj16](#):
>
> You can tar'ing up and gzip'ing a closed index and deleting the original directory, then unzip'ing and re-opening the index in ES and that works. I've tried this once in my environment.

To be clear, in no sense does this process "work" as a backup solution, and this fact is called out in the [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html):

> WARNING: It is not possible to back up an Elasticsearch cluster simply by taking a copy of the data directories of all of its nodes. Elasticsearch may be making changes to the contents of its data directories while it is running, and this means that copying its data directories cannot be expected to capture a consistent picture of their contents. Attempts to restore a cluster from such a backup may fail, reporting corruption and/or missing files, or may appear to have succeeded having silently lost some of its data. **The only reliable way to back up a cluster is by using the snapshot and restore functionality.**

In versions 7.2.0 and later you can [snapshot closed indices](https://github.com/elastic/elasticsearch/pull/39644). In earlier versions you must re-open them to take a snapshot, and this is the only reliable and supported way to make a backup.

---

<div class="post-metadata">

**Author:** ![harshbajaj16](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/harshbajaj16/32/44970_2.png) [@harshbajaj16](https://discuss.elastic.co/u/harshbajaj16)\
**Post date:** [July 16, 2019, 6:30am UTC](https://discuss.elastic.co/t/how-to-takes-elasticsearch-backup-on-closed-indexes-in-a-clustered-environment/190635/4 "2019-07-16T06:30:23Z")

</div>

Hi @DavidTurner,

I also agree with it thats why i mentioned its temp. solution and will work it or not. I give this because i have tried once in my environment and it worked for me.

> [@DavidTurner](#):
>
> To be clear, in no sense does this process "work" as a backup solution, and this fact is called out in the [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html):

Regards,  
Harsh Bajaj

---

<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:** [August 13, 2019, 6:30am UTC](https://discuss.elastic.co/t/how-to-takes-elasticsearch-backup-on-closed-indexes-in-a-clustered-environment/190635/5 "2019-08-13T06:30:26Z")

</div>

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