# Backup indices

**URL:** <https://discuss.elastic.co/t/backup-indices/56634>\
**Category:** Elasticsearch\
**Created:** [July 28, 2016, 2:15pm UTC](https://discuss.elastic.co/t/backup-indices/56634 "2016-07-28T14:15:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pittoch](https://avatars.discourse-cdn.com/v4/letter/p/df788c/32.png) [@pittoch](https://discuss.elastic.co/u/pittoch)\
**Post date:** [July 28, 2016, 2:15pm UTC](https://discuss.elastic.co/t/backup-indices/56634/1 "2016-07-28T14:15:38Z")

</div>

Hello  
I tested the snapshot feature and restoration with this doc:  
[https://www.elastic.co/guide/en/elasticsearch/guide/current/backing-up-your-cluster.html](https://www.elastic.co/guide/en/elasticsearch/guide/current/backing-up-your-cluster.html)

. It works perfectly.

I have still two questions:

1. how to make a snapshot of the structure indices, therefore without the data.

2. when I restore the snapshot, scripted fields are not restored.  
How can I include it in the snapshot?

Thanks

---

<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:** [July 28, 2016, 2:29pm UTC](https://discuss.elastic.co/t/backup-indices/56634/2 "2016-07-28T14:29:00Z")

</div>

1. You don't need snapshot and restore for that. Just run something like `GET index/_mapping` and save the JSON document you are getting back.

2. No idea... 🙂 Actually I don't think you can. [Script fields are computed dynamically when running a search query](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-script-fields.html). So just run the same queries you used to run...

---

<div class="post-metadata">

**Author:** ![pittoch](https://avatars.discourse-cdn.com/v4/letter/p/df788c/32.png) [@pittoch](https://discuss.elastic.co/u/pittoch)\
**Post date:** [July 28, 2016, 8:05pm UTC](https://discuss.elastic.co/t/backup-indices/56634/3 "2016-07-28T20:05:47Z")

</div>

When I create a new indice structure, I start my logstash configuration with the binary, then in Indice, I create the new Indice. After I add manualy the scripted fields.  
So, if I export the json, how can I reimport it in Elasticsearch ?

---

<div class="post-metadata">

**Author:** ![pittoch](https://avatars.discourse-cdn.com/v4/letter/p/df788c/32.png) [@pittoch](https://discuss.elastic.co/u/pittoch)\
**Post date:** [July 29, 2016, 6:11am UTC](https://discuss.elastic.co/t/backup-indices/56634/4 "2016-07-29T06:11:38Z")

</div>

I found how I can create a indices in command line ([https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html))

WIth a other command like GET index/\_mapping , we can get scripted fields configuration to backup in a json file ?

---

<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:** [July 5, 2017, 10:31pm UTC](https://discuss.elastic.co/t/backup-indices/56634/5 "2017-07-05T22:31:53Z")

</div>


