# Backing up ElasticSearch's configuration ONLY

**URL:** <https://discuss.elastic.co/t/backing-up-elasticsearchs-configuration-only/85672>\
**Category:** Elasticsearch\
**Created:** [May 14, 2017, 7:48am UTC](https://discuss.elastic.co/t/backing-up-elasticsearchs-configuration-only/85672 "2017-05-14T07:48:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![X\_Calibur](https://avatars.discourse-cdn.com/v4/letter/x/b2d939/32.png) [@X\_Calibur](https://discuss.elastic.co/u/X_Calibur)\
**Post date:** [May 14, 2017, 7:48am UTC](https://discuss.elastic.co/t/backing-up-elasticsearchs-configuration-only/85672/1 "2017-05-14T07:48:07Z")

</div>

Hi,

From the docs I can see how to backup the indices.  
However that could take a hefty amount of time.  
Is there a way to backup just the configuration itself i.e templates, alerts, mappings etc?

thanks  
gil

---

<div class="post-metadata">

**Author:** ![rclarke](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rclarke/32/68604_2.png) [@rclarke](https://discuss.elastic.co/u/rclarke)\
**Post date:** [May 19, 2017, 6:27am UTC](https://discuss.elastic.co/t/backing-up-elasticsearchs-configuration-only/85672/2 "2017-05-19T06:27:49Z")

</div>

Hello Gil,

Yes - you can do this using snapshot/restore and the `include_global_state` parameter - here's an example to illustrate.

```
# Repository to store cluster state in
PUT /_snapshot/my_backup
{
  "type": "fs",
  "settings": {
        "location": "/path/to/repo"
  }
}

# Put a template, and confirm it exists
PUT _template/test
{
  "template": "test-*",
  "settings": {
    "number_of_shards": 1
  }
}
GET /_template/test

# Create a snapshot including cluster state
# DELETE _snapshot/my_backup/snapshot_1
PUT /_snapshot/my_backup/snapshot_1
{
  "indices": "not_an_index_which_exists",
  "ignore_unavailable": true,
  "include_global_state": true
}
GET /_snapshot/my_backup/snapshot_1

# Delete template and ensure it is gone
DELETE _template/test
GET /_template/test

# Restore the snapshot
POST /_snapshot/my_backup/snapshot_1/_restore
{
  "include_global_state":true
}

# Confirm template has been recreated
GET /_template/test

```

You can find further documentation [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html#_restore) including:

> If cluster state is restored with include\_global\_state (defaults to false), the restored templates that don’t currently exist in the cluster are added and existing templates with the same name are replaced by the restored templates. The restored persistent settings are added to the existing persistent settings.

---

<div class="post-metadata">

**Author:** ![X\_Calibur](https://avatars.discourse-cdn.com/v4/letter/x/b2d939/32.png) [@X\_Calibur](https://discuss.elastic.co/u/X_Calibur)\
**Post date:** [May 23, 2017, 10:14am UTC](https://discuss.elastic.co/t/backing-up-elasticsearchs-configuration-only/85672/3 "2017-05-23T10:14:55Z")

</div>

Hi

I just tested this out.  
It does not seem like it backs up Watchers.  
Is there a solution to that?

Thanks  
Gil

---

<div class="post-metadata">

**Author:** ![rclarke](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rclarke/32/68604_2.png) [@rclarke](https://discuss.elastic.co/u/rclarke)\
**Post date:** [May 23, 2017, 11:32am UTC](https://discuss.elastic.co/t/backing-up-elasticsearchs-configuration-only/85672/4 "2017-05-23T11:32:41Z")

</div>

Hello Gil,

For watches you will have to include the `.watches` index.

Cheers,  
-Robin-

---

<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, 2017, 11:38am UTC](https://discuss.elastic.co/t/backing-up-elasticsearchs-configuration-only/85672/5 "2017-06-20T11:38:24Z")

</div>

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