# \_reindex: Validation Failed: 1: id is too long, must be no longer than 512 bytes but was: 1012

**URL:** <https://discuss.elastic.co/t/reindex-validation-failed-1-id-is-too-long-must-be-no-longer-than-512-bytes-but-was-1012/117768>\
**Category:** Elasticsearch\
**Created:** [January 31, 2018, 8:33am UTC](https://discuss.elastic.co/t/reindex-validation-failed-1-id-is-too-long-must-be-no-longer-than-512-bytes-but-was-1012/117768 "2018-01-31T08:33:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![willsun5\_2000](https://avatars.discourse-cdn.com/v4/letter/w/ad7895/32.png) [@willsun5\_2000](https://discuss.elastic.co/u/willsun5_2000)\
**Post date:** [January 31, 2018, 8:33am UTC](https://discuss.elastic.co/t/reindex-validation-failed-1-id-is-too-long-must-be-no-longer-than-512-bytes-but-was-1012/117768/1 "2018-01-31T08:33:27Z")

</div>

This is an elasticsearch platform upgrade project, we are targeting to migrate legacy data which is collected in past 2 years from elasticsearch 1.5.\* to 6.1._.  
when I perform \_reindex to move the data, I got the following errors.  
I already know it's the limitation of \_id since 2._  
my \_mappings like  
{  
"\_index": "index",  
"\_type": "url",  
"\_id": "http://\*\*\*\*\*",  
"\_score": 1,  
"\_source": {  
"url": "https://\*\*\*\*(the same value as \_id)",  
"created": "2018-01-31T03:57:37.433Z",  
"updated": "2018-01-31T03:57:37.433Z",  
"status": "",  
"fetched": ""  
}  
}  
but I want to know any best practice to solve this problem

---

<div class="post-metadata">

**Author:** ![willsun5\_2000](https://avatars.discourse-cdn.com/v4/letter/w/ad7895/32.png) [@willsun5\_2000](https://discuss.elastic.co/u/willsun5_2000)\
**Post date:** [February 3, 2018, 1:53pm UTC](https://discuss.elastic.co/t/reindex-validation-failed-1-id-is-too-long-must-be-no-longer-than-512-bytes-but-was-1012/117768/2 "2018-02-03T13:53:49Z")

</div>

this works for me, the new id will be generated with hash  
POST \_reindex?pretty&wait\_for\_completion=false  
{  
"conflicts": "proceed",  
"source": {  
"remote": {  
"host": "http://"  
},  
"index": "index",  
"size":1000  
},  
"dest": {  
"index": "index",  
"version\_type": "internal"  
},  
"script": {  
"lang": "painless",  
"source": "ctx.\_id=null"  
}  
}

---

<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:** [March 3, 2018, 1:54pm UTC](https://discuss.elastic.co/t/reindex-validation-failed-1-id-is-too-long-must-be-no-longer-than-512-bytes-but-was-1012/117768/3 "2018-03-03T13:54:07Z")

</div>

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