# Reindex 5.3 to 6.8 Mapping Errors

**URL:** <https://discuss.elastic.co/t/reindex-5-3-to-6-8-mapping-errors/191263>\
**Category:** Elasticsearch\
**Created:** [July 18, 2019, 5:59pm UTC](https://discuss.elastic.co/t/reindex-5-3-to-6-8-mapping-errors/191263 "2019-07-18T17:59:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![amancipe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amancipe/32/50481_2.png) [@amancipe](https://discuss.elastic.co/u/amancipe)\
**Post date:** [July 18, 2019, 5:59pm UTC](https://discuss.elastic.co/t/reindex-5-3-to-6-8-mapping-errors/191263/1 "2019-07-18T17:59:45Z")

</div>

I'm trying to perform a remote reindex from 5.3 - 6.8 clusters. I have added all custom fields to my new 6.8 template which should accommodate all fields for indexes in old cluster. However I'm getting the following error, and I can't see to get it to work, "Object mapping for [host] tried to parse field [host] as object, but found a concrete value". What do I need to change to make this work? There is no mention of this specific issue, the closest thing I see is people having issues with logstash.

---

<div class="post-metadata">

**Author:** ![Shaoranlaos](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@Shaoranlaos](https://discuss.elastic.co/u/Shaoranlaos)\
**Post date:** [July 19, 2019, 5:30am UTC](https://discuss.elastic.co/t/reindex-5-3-to-6-8-mapping-errors/191263/2 "2019-07-19T05:30:35Z")

</div>

I had a similar issue when i update to 6.x (dont now which version it was).

You can make your reindex work with the following script in the reindex call:

```auto
POST _reindex?wait_for_completion=true&refresh=true
{
  "source": {
    "index": "xxxx"
  },
  "dest": {
    "index": "xxx"
  }
  ,"script": {
    "source": "if (ctx._source.host instanceof String) {String host=ctx._source.host;ctx._source.host=['name':host];}"
  }
}

```

This will change the host field that was previously directly the hostname to an object where the name field is set to the previous value.

~~Second Possibility: because this is simply a mapping issue you could proberly simply set the field host to keyword again and it should work (haven't tested it so no promise).~~

Forget the second possibility you will likly have beats and logstash running which will use the new format.

---

<div class="post-metadata">

**Author:** ![amancipe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amancipe/32/50481_2.png) [@amancipe](https://discuss.elastic.co/u/amancipe)\
**Post date:** [July 22, 2019, 8:15pm UTC](https://discuss.elastic.co/t/reindex-5-3-to-6-8-mapping-errors/191263/3 "2019-07-22T20:15:49Z")

</div>

Life saver! That worked perfectly, thanks a lot.

---

<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:** [August 19, 2019, 8:15pm UTC](https://discuss.elastic.co/t/reindex-5-3-to-6-8-mapping-errors/191263/4 "2019-08-19T20:15:51Z")

</div>

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