# Reindex from 2.x to elastic 5.x

**URL:** <https://discuss.elastic.co/t/reindex-from-2-x-to-elastic-5-x/271333>\
**Category:** Elasticsearch\
**Tags:** migration, reindex\
**Created:** [April 27, 2021, 8:35am UTC](https://discuss.elastic.co/t/reindex-from-2-x-to-elastic-5-x/271333 "2021-04-27T08:35:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lmrc](https://avatars.discourse-cdn.com/v4/letter/l/71c47a/32.png) [@lmrc](https://discuss.elastic.co/u/lmrc)\
**Post date:** [April 27, 2021, 8:35am UTC](https://discuss.elastic.co/t/reindex-from-2-x-to-elastic-5-x/271333/1 "2021-04-27T08:35:18Z")

</div>

Good morning everyone,

I am trying to upgrade elasticsearch with graylog to the newest version. Currently I have the elasticsearch indexes in version 1.7, I can read them from elasticsearch 2.x but I need to reindex to be able to read them in versions 5.x or higher.

For this I am trying to use the reindexing API, but I am getting the following error several times:

"{  
“index”: “graylog\_2023\_re”,  
“type”: “message”,  
“id”: “f27395d1-92d6-11eb-9a08-525400f612cd”,  
“cause”: {  
“type”: “mapper\_parsing\_exception”,  
“reason”: “Field [\_id] is a metadata field and cannot be added inside a document. Use the index API request parameters.”  
},  
“status”: 400  
},  
{  
"

Can somebody help me? Thank you.

---

<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:** [April 28, 2021, 1:36am UTC](https://discuss.elastic.co/t/reindex-from-2-x-to-elastic-5-x/271333/2 "2021-04-28T01:36:49Z")

</div>

Welcome to our community! 😃

What is the request that you passing to Elasticsearch?

---

<div class="post-metadata">

**Author:** ![lmrc](https://avatars.discourse-cdn.com/v4/letter/l/71c47a/32.png) [@lmrc](https://discuss.elastic.co/u/lmrc)\
**Post date:** [April 28, 2021, 8:24am UTC](https://discuss.elastic.co/t/reindex-from-2-x-to-elastic-5-x/271333/3 "2021-04-28T08:24:36Z")

</div>

Hi, Thank you @warkolm

The request I was passing to Elasticsearch are:

> curl -H 'Content-Type: application/json' -X POST localhost:9200/\_reindex?pretty -d'{  
> "source": {  
> "remote": {  
> "host": "[http://RemoteIP:9200](http://RemoteIP:9200)"  
> },  
> "index": "OriginalName"  
> },  
> "dest": {  
> "index": "NewReindexName"  
> }  
> }'

I have seen that the problem may be occurring due to the \_id field in the indexes but I don't know what the solution could be.

Thank you very much!

---

<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:** [May 26, 2021, 8:25am UTC](https://discuss.elastic.co/t/reindex-from-2-x-to-elastic-5-x/271333/4 "2021-05-26T08:25:08Z")

</div>

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