# Reindex 5.4.0 to 7.1.1

**URL:** <https://discuss.elastic.co/t/reindex-5-4-0-to-7-1-1/186512>\
**Category:** Elasticsearch\
**Created:** [June 19, 2019, 3:32pm UTC](https://discuss.elastic.co/t/reindex-5-4-0-to-7-1-1/186512 "2019-06-19T15:32:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nick\_Carn](https://avatars.discourse-cdn.com/v4/letter/n/f6c823/32.png) [@Nick\_Carn](https://discuss.elastic.co/u/Nick_Carn)\
**Post date:** [June 19, 2019, 3:32pm UTC](https://discuss.elastic.co/t/reindex-5-4-0-to-7-1-1/186512/1 "2019-06-19T15:32:35Z")

</div>

Hi there,

I'm reindexing from remote. I have two slightly different document types (not es types). One i can reindex without problems, the other i get the error below. I can create a document manually from the \_source but not using the reindex api.

Any ideas?

Thanks,  
Nick

[https://pastebin.com/U3vgG5ST](https://pastebin.com/U3vgG5ST)

```
  "error" : {
    "type" : "exception",
    "reason" : "Error parsing the response, remote is likely not an Elasticsearch instance",
    "caused_by" : {
      "type" : "x_content_parse_exception",
      "reason" : "[1:1437] [search_response] failed to parse field [hits]",
      "caused_by" : {
        "type" : "x_content_parse_exception",
        "reason" : "[1:1437] [hits] failed to parse field [hits]",
        "caused_by" : {
          "type" : "x_content_parse_exception",
          "reason" : "[1:1437] [hit] failed to parse field [_source]",
          "caused_by" : {
            "type" : "parsing_exception",
            "reason" : "[hit] failed to parse [_source]",
            "line" : 1,
            "col" : 1437,
            "caused_by" : {
              "type" : "json_parse_exception",
              "reason" : "Duplicate field 'locationType'\n at [Source: org.apache.http.nio.entity.ContentInputStream@7f406601; line: 1, column: 1464]",
              "suppressed" : [
                {
                  "type" : "illegal_state_exception",
                  "reason" : "Failed to close the XContentBuilder",
                  "caused_by" : {
                    "type" : "i_o_exception",
                    "reason" : "Unclosed object or array found"
                  }
                }
              ]
            }
```

---

<div class="post-metadata">

**Author:** ![wangqinghuan](https://avatars.discourse-cdn.com/v4/letter/w/d26b3c/32.png) [@wangqinghuan](https://discuss.elastic.co/u/wangqinghuan)\
**Post date:** [June 19, 2019, 5:15pm UTC](https://discuss.elastic.co/t/reindex-5-4-0-to-7-1-1/186512/2 "2019-06-19T17:15:13Z")

</div>

The problem is "duplicate field", you are indexing documents with duplicate fields into a newer version elasticsearch that does not allow duplicate fields to exist by default.

---

<div class="post-metadata">

**Author:** ![Nick\_Carn](https://avatars.discourse-cdn.com/v4/letter/n/f6c823/32.png) [@Nick\_Carn](https://discuss.elastic.co/u/Nick_Carn)\
**Post date:** [June 20, 2019, 7:51am UTC](https://discuss.elastic.co/t/reindex-5-4-0-to-7-1-1/186512/3 "2019-06-20T07:51:38Z")

</div>

HI Wang,

Thank you for looking and replying.

There is definitely no duplicate field. I tried to reindex just one of the documents that fail and it throws that i\_o\_exception. I can index that document manually by posting the json, just not through the reindex API.

Here's the soure document [https://pastebin.com/KtHTezMw](https://pastebin.com/KtHTezMw)

I even tried to index the document manually to create the dynamic mappings, deleting the doc and then reindex it through the API, and that fails with the same exception.

Any help appreciated.

Thanks,  
Nick

---

<div class="post-metadata">

**Author:** ![Nick\_Carn](https://avatars.discourse-cdn.com/v4/letter/n/f6c823/32.png) [@Nick\_Carn](https://discuss.elastic.co/u/Nick_Carn)\
**Post date:** [June 20, 2019, 11:34am UTC](https://discuss.elastic.co/t/reindex-5-4-0-to-7-1-1/186512/4 "2019-06-20T11:34:39Z")

</div>

I figured it out. I had to remove the \_type, but that still threw the exception. So i also had to be explicit about what i wanted to include.

```
POST _reindex?wait_for_completion=false
{
  "source": {
"remote": {
  "host": "http://training-es5.videotel-stage.com:9200"
},
"index": "cts-training",
"_source": {
  "include": [
    "key",
    "origin",
    "originKey",
    "generationDate",
    "who",
    "when",
    "where",
    "what",
    "verified"
    ]
},      
  "query": { "bool": {"must_not": [
{ "term": {
  "type": {
    "value": "training"
  }
}}
  ]}}
  },
  "dest": {
"index": "cts-training2"
  },
  "script": {
"source": """
  ctx._source.type = ctx._type;
  ctx._type = '_doc';
"""
  }
 }
```

---

<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 18, 2019, 11:34am UTC](https://discuss.elastic.co/t/reindex-5-4-0-to-7-1-1/186512/5 "2019-07-18T11:34:58Z")

</div>

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