# Reindex from 5.5 to 6.2 with different mapping

**URL:** https://discuss.elastic.co/t/reindex-from-5-5-to-6-2-with-different-mapping/152708
**Category:** Elasticsearch
**Created:** [October 16, 2018, 7:15pm UTC](https://discuss.elastic.co/t/reindex-from-5-5-to-6-2-with-different-mapping/152708 "2018-10-16T19:15:52Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![mmbtenorio](https://avatars.discourse-cdn.com/v4/letter/m/ebca7d/32.png) [@mmbtenorio](https://discuss.elastic.co/u/mmbtenorio)
#### Post date: [October 16, 2018, 7:15pm UTC](https://discuss.elastic.co/t/reindex-from-5-5-to-6-2-with-different-mapping/152708/1 "2018-10-16T19:15:52Z")

</div>

Hello, we're in the middle of upgrading our Elastic Stack from 5.5 to 6.2.4. I know the multi-type is already deprecated in version 6, so when we created the indices, we specify that the type of each index is "doc". The thing is, I cannot reindex from 5.5 because the type is different from source index to destination index. How can I resolve this? Is it possible to update the type in version 5.5 before reindexing?

---

<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 16, 2018, 9:11pm UTC](https://discuss.elastic.co/t/reindex-from-5-5-to-6-2-with-different-mapping/152708/2 "2018-10-16T21:11:48Z")

</div>

> [@mmbtenorio](#):
>
> The thing is, I cannot reindex from 5.5 because the type is different from source index to destination index

Can you elaborate a little more on this, what do you mean by different?

---

<div class="post-metadata">

### Author: ![jakelandis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jakelandis/32/36163_2.png) [@jakelandis](https://discuss.elastic.co/u/jakelandis)
#### Post date: [October 16, 2018, 9:21pm UTC](https://discuss.elastic.co/t/reindex-from-5-5-to-6-2-with-different-mapping/152708/3 "2018-10-16T21:21:31Z")

</div>

I'm going to guess that you may want to use a script for the \_reindex to change/update the type. [https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html)

For example:

```auto
DELETE old
DELETE new
PUT old/custom_type/1
{
  "foo" : "bar"
}
GET old/custom_type/1
POST _reindex
{
  "source": {
    "index": "old",
    "type": "custom_type"
  },
  "dest": {
    "index": "new"
  },
   "script": {
    "source": "ctx._type = '_doc'",
    "lang": "painless"
  }
}
GET new/_doc/1

```

You can also achieve the same outcome by specifying an ingest node pipeline for the re-index and having that pipeline set the `_type` [https://www.elastic.co/guide/en/elasticsearch/reference/current/accessing-data-in-pipelines.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/accessing-data-in-pipelines.html)

---

<div class="post-metadata">

### Author: ![mmbtenorio](https://avatars.discourse-cdn.com/v4/letter/m/ebca7d/32.png) [@mmbtenorio](https://discuss.elastic.co/u/mmbtenorio)
#### Post date: [October 17, 2018, 10:02am UTC](https://discuss.elastic.co/t/reindex-from-5-5-to-6-2-with-different-mapping/152708/4 "2018-10-17T10:02:29Z")

</div>

Thank you! This solution works for me 🙂

---

<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 14, 2018, 10:14am UTC](https://discuss.elastic.co/t/reindex-from-5-5-to-6-2-with-different-mapping/152708/5 "2018-11-14T10:14:21Z")

</div>

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