# Error while reindexing from 1.7 to 2.4

**URL:** <https://discuss.elastic.co/t/error-while-reindexing-from-1-7-to-2-4/158598>\
**Category:** Elasticsearch\
**Created:** [November 28, 2018, 3:02pm UTC](https://discuss.elastic.co/t/error-while-reindexing-from-1-7-to-2-4/158598 "2018-11-28T15:02:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sylvainb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylvainb/32/32162_2.png) [@sylvainb](https://discuss.elastic.co/u/sylvainb)\
**Post date:** [November 28, 2018, 3:02pm UTC](https://discuss.elastic.co/t/error-while-reindexing-from-1-7-to-2-4/158598/1 "2018-11-28T15:02:59Z")

</div>

Hi there,

I'm migrating an elasticsearch instance from 1.7 to 2.4.  
When trying to reindex my documents, after having upgraded my server, I got the following error:

```bash
curl -XPOST "$ES_IP:9200/_reindex?pretty" 2>/dev/null -H 'Content-Type: application/json' -d '{
      "source": {
        "index": "stats"
      },
      "dest": {
        "index": "stats_24"
      }
    }'

```

```json
{
  "took" : 2528,
  "timed_out" : false,
  "total" : 13515,
  "updated" : 0,
  "created" : 0,
  "batches" : 1,
  "version_conflicts" : 0,
  "noops" : 0,
  "retries" : 0,
  "throttled_millis" : 0,
  "requests_per_second" : "unlimited",
  "throttled_until_millis" : 0,
  "failures" : [ {
    "index" : "stats_24",
    "type" : "account",
    "id" : "55ace2996661624cb9910100",
    "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
  }, {
    "index" : "stats_24",
    "type" : "user",
    "id" : "55ace2946661624cb9860000",
    "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
  }, {
    "index" : "stats_24",
    "type" : "machine",
    "id" : "55ace2a76661624cb9fa0400",
    "cause" : {
      "type" : "mapper_parsing_exception",
      "reason" : "Cannot generate dynamic mappings of type [_id] for [_id]"
    },
    "status" : 400
  },
 ...

```

So I don't understand because there is no "\_id" fields inside the source documents.

I saw [in this thread](https://discuss.elastic.co/t/how-to-change-a-documents--id-during-a-reindex/76132) that someone uses a script to changes its ids. So I've tried it, but it ends in:

```auto
"type" : "illegal_argument_exception",
"reason" : "script_lang not supported [painless]"

```

or, if I omit the "lang" part:

```auto
"type" : "script_exception",
"reason" : "scripts of type [inline], operation [update] and lang [groovy] are disabled"

```

Here's my elasticsearch.yml

```auto
http.host: 0.0.0.0
script.inline: true
script.stored: true
script.painless.regex.enabled: true
script.engine.groovy.inline.update: on
path.repo: /usr/share/elasticsearch

```

I really don't know where to go next ... 😥 Does anyone has any idea to solve this?

---

<div class="post-metadata">

**Author:** ![sylvainb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylvainb/32/32162_2.png) [@sylvainb](https://discuss.elastic.co/u/sylvainb)\
**Post date:** [November 29, 2018, 2:33pm UTC](https://discuss.elastic.co/t/error-while-reindexing-from-1-7-to-2-4/158598/2 "2018-11-29T14:33:36Z")

</div>

Ok, I finally found the solution.  
My installation was based on docker-compose and, to validate my changes, I was running:

```bash
docker-compose restart

```

But this was not enough, my docker volume for the _config_ directory, that I added afterwards, was not mounted.  
I needed to run the following commands:

```bash
docker-compose stop elasticsearch
docker-compose rm -f elasticsearch
docker-compose up -d

```

Note that, even with that painless was not enabled but I used script [described here](https://github.com/elastic/elasticsearch-migration/issues/91) to make my migration run.

---

<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:** [December 27, 2018, 2:33pm UTC](https://discuss.elastic.co/t/error-while-reindexing-from-1-7-to-2-4/158598/3 "2018-12-27T14:33:49Z")

</div>

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