# 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:** 1\
**Showing post:** 4

<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';
"""
  }
 }
```

---

_[View the full topic](https://discuss.elastic.co/t/reindex-5-4-0-to-7-1-1/186512)._
