# How do I copy and modify a schema?

**URL:** <https://discuss.elastic.co/t/how-do-i-copy-and-modify-a-schema/316477>\
**Category:** Elasticsearch\
**Created:** [October 13, 2022, 12:22am UTC](https://discuss.elastic.co/t/how-do-i-copy-and-modify-a-schema/316477 "2022-10-13T00:22:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wpm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wpm/32/110146_2.png) [@wpm](https://discuss.elastic.co/u/wpm)\
**Post date:** [October 13, 2022, 12:22am UTC](https://discuss.elastic.co/t/how-do-i-copy-and-modify-a-schema/316477/1 "2022-10-13T00:22:59Z")

</div>

I indexed a bunch of documents and let Elastic automatically pick the field types. It got some of them right and some of them wrong. (e.g. a field is `keyword` when it should be `string` and vice versa). My documents have many fields, and it appears the easiest thing to do will be to copy the schema, modify the types I don't like, and reingest.

Is this a standard strategy? What is the easiest way to go about it? Can I do the whole procedure in Kibana.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 13, 2022, 12:59am UTC](https://discuss.elastic.co/t/how-do-i-copy-and-modify-a-schema/316477/2 "2022-10-13T00:59:06Z")

</div>

It's a mapping in Elasticsearch, not a schema like a database 🙂

You can get it via `GET INDEX/_mapping`.  
You cannot update a mapping for an existing field, you will need to create a new index with the updated mapping and then do a reindex.

---

<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:** [November 10, 2022, 12:59am UTC](https://discuss.elastic.co/t/how-do-i-copy-and-modify-a-schema/316477/3 "2022-11-10T00:59:16Z")

</div>

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