# Possible to rename Doctype

**URL:** <https://discuss.elastic.co/t/possible-to-rename-doctype/58766>\
**Category:** Elasticsearch\
**Created:** [August 24, 2016, 6:01am UTC](https://discuss.elastic.co/t/possible-to-rename-doctype/58766 "2016-08-24T06:01:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![newbie\_here](https://avatars.discourse-cdn.com/v4/letter/n/dbc845/32.png) [@newbie\_here](https://discuss.elastic.co/u/newbie_here)\
**Post date:** [August 24, 2016, 6:01am UTC](https://discuss.elastic.co/t/possible-to-rename-doctype/58766/1 "2016-08-24T06:01:47Z")

</div>

Hi,  
I have a case in my streaming data where I need to rename my doctype to another for a temporary amount of time? Is it possible to rename the doctype of the index without disturbing other aspects of the Index.?

---

<div class="post-metadata">

**Author:** ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)\
**Post date:** [August 24, 2016, 6:38am UTC](https://discuss.elastic.co/t/possible-to-rename-doctype/58766/2 "2016-08-24T06:38:32Z")

</div>

Hi,

you cannot rename a type but you can create a new one.

For example, if you're index contains `my_type`, you can create `my_temporary_other_type` (but use the same mapping for it, otherwise you may have problems later). When you don't need it anymore but want to have the data available in `my_type` too, you can use the [reindex API](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html) to reindex the data from `my_temporary_other_typemy_temporary_other_type`to `my_type` again. This is were you need to be sure that the mapping of both types is the same. Apart from that, same field names have to have the same mapping types, even across different types.

Daniel

---

<div class="post-metadata">

**Author:** ![newbie\_here](https://avatars.discourse-cdn.com/v4/letter/n/dbc845/32.png) [@newbie\_here](https://discuss.elastic.co/u/newbie_here)\
**Post date:** [October 14, 2016, 8:21am UTC](https://discuss.elastic.co/t/possible-to-rename-doctype/58766/3 "2016-10-14T08:21:25Z")

</div>

Thank you for your advice. It was really helpful. 🙂

---

<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:12pm UTC](https://discuss.elastic.co/t/possible-to-rename-doctype/58766/4 "2017-07-05T22:12:24Z")

</div>


