# Recreate index from GET mappings output

**URL:** <https://discuss.elastic.co/t/recreate-index-from-get-mappings-output/295159>\
**Category:** Elasticsearch\
**Created:** [January 23, 2022, 8:30pm UTC](https://discuss.elastic.co/t/recreate-index-from-get-mappings-output/295159 "2022-01-23T20:30:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![markrity](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/markrity/32/100712_2.png) [@markrity](https://discuss.elastic.co/u/markrity)\
**Post date:** [January 23, 2022, 8:30pm UTC](https://discuss.elastic.co/t/recreate-index-from-get-mappings-output/295159/1 "2022-01-23T20:30:26Z")

</div>

I'm trying to find a way to recreate all index mappings from when I use `GET /_all/_mapping` or iterate over each index.  
For creating development cluster purposes.  
I have tried to use the json I get from get all mappings with Elasticsearch nodejs client, but putting the `mappings` object into `client.index` with specifying index name and mappings object as a mappings.

But it still didn't worked out as expected.

Is there a better way to "backup" mappings of indexes and recreating them ?

---

<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:** [February 20, 2022, 8:30pm UTC](https://discuss.elastic.co/t/recreate-index-from-get-mappings-output/295159/2 "2022-02-20T20:30:39Z")

</div>

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