# Reindex error in version6 after upgrading it from ESv5

**URL:** <https://discuss.elastic.co/t/reindex-error-in-version6-after-upgrading-it-from-esv5/336529>\
**Category:** Elasticsearch\
**Created:** [June 21, 2023, 4:55am UTC](https://discuss.elastic.co/t/reindex-error-in-version6-after-upgrading-it-from-esv5/336529 "2023-06-21T04:55:44Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![sonujatav35](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sonujatav35/32/90308_2.png) [@sonujatav35](https://discuss.elastic.co/u/sonujatav35)\
**Post date:** [June 21, 2023, 4:55am UTC](https://discuss.elastic.co/t/reindex-error-in-version6-after-upgrading-it-from-esv5/336529/1 "2023-06-21T04:55:44Z")

</div>

Hi ES Community,

I need some advice, I have to perform reindexing operation after upgrading the ES from v5 to v6. But while doing the reindexing i am getting the some mapping error. I am not very much sure which part should i update in the mapping so that reindexing can be acceptable by v6?

```auto
{
"index-name-2022": {
"mappings": {
"xxx-mapping-name": {
"properties": {
"@timestamp": {
"type": "date"
},
"@version": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"AVERAGE": {
"type": "long"
},
"COLUMN_LABEL": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"KEY_VALUE": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"MAXIMUM": {
"type": "long"
},
"MINIMUM": {
"type": "long"
},
"TARGET_NAME": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
}
}
}
}

```

Error:

```auto
 "reason" : "mapper [MAXIMUM] cannot be changed from type [long] to [float]"

```

Thanks  
Sonu

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 21, 2023, 7:16am UTC](https://discuss.elastic.co/t/reindex-error-in-version6-after-upgrading-it-from-esv5/336529/2 "2023-06-21T07:16:25Z")

</div>

Change this part:

```auto
"MAXIMUM": {
   "type": "long"
},

```

Use the `double`.

---

<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:** [June 21, 2023, 7:39am UTC](https://discuss.elastic.co/t/reindex-error-in-version6-after-upgrading-it-from-esv5/336529/3 "2023-06-21T07:39:38Z")

</div>

Also you might want to keep upgrading, as 6.X is EOL.

---

<div class="post-metadata">

**Author:** ![sonujatav35](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sonujatav35/32/90308_2.png) [@sonujatav35](https://discuss.elastic.co/u/sonujatav35)\
**Post date:** [June 21, 2023, 8:03am UTC](https://discuss.elastic.co/t/reindex-error-in-version6-after-upgrading-it-from-esv5/336529/4 "2023-06-21T08:03:11Z")

</div>

Hi @dadoonet thanks for putting the your side comment on my question.  
I have this old index mapping.

```auto
{
  "index-name" : {
    "mappings" : {
      "_default_" : {
        "_all" : {
          "enabled" : true,
          "norms" : false
        },
        "dynamic_templates" : [
          {
            "template1" : {
              "match" : "*",
              "mapping" : {
                "doc_values" : true,
                "ignore_above" : 10240,
                "index" : "not_analyzed",
                "type" : "{dynamic_type}"
              }
            }
          }
        ],
        "properties" : {
          "@timestamp" : {
            "type" : "date"
          }
        }
      },
      "index-name" : {
        "_all" : {
          "enabled" : true,
          "norms" : false
        },
        "dynamic_templates" : [
          {
            "template1" : {
              "match" : "*",
              "mapping" : {
                "doc_values" : true,
                "ignore_above" : 10240,
                "index" : "not_analyzed",
                "type" : "{dynamic_type}"
              }
            }
          }
        ],
        "properties" : {
          "@timestamp" : {
            "type" : "date"
          },
          "@version" : {
            "type" : "keyword",
            "ignore_above" : 10240
          },
          "AVERAGE" : {
            "type" : "float"
          },
          "COLUMN_LABEL" : {
            "type" : "keyword",
            "ignore_above" : 10240
          },
          "KEY_VALUE" : {
            "type" : "keyword",
            "ignore_above" : 10240
          },
          "MAXIMUM" : {
            "type" : "float"
          },
          "MINIMUM" : {
            "type" : "float"
          },
          "TARGET_NAME" : {
            "type" : "keyword",
            "ignore_above" : 10240
          }
        }
      }
    }
  }
}

```

Is it okay to follow below this step:

- First create the new mapping with new index.
- After that use the reindex api to copy the data.

To create new mapping how can i refer the above one mapping? I would like to know, How to create the new mapping by referring the above one?

Thanks  
Sonu

---

<div class="post-metadata">

**Author:** ![sonujatav35](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sonujatav35/32/90308_2.png) [@sonujatav35](https://discuss.elastic.co/u/sonujatav35)\
**Post date:** [June 21, 2023, 8:04am UTC](https://discuss.elastic.co/t/reindex-error-in-version6-after-upgrading-it-from-esv5/336529/5 "2023-06-21T08:04:18Z")

</div>

@warkolm for version-up preparation i have to go through this reindexing.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 21, 2023, 8:53am UTC](https://discuss.elastic.co/t/reindex-error-in-version6-after-upgrading-it-from-esv5/336529/6 "2023-06-21T08:53:53Z")

</div>

As @warkolm stated, you should use directly the 8.8.1 version and use the reindex from remote api.  
It does not make a lot of sense to reindex multiple times actually....

So prepare your mapping for 8.8 instead.

---

<div class="post-metadata">

**Author:** ![sonujatav35](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sonujatav35/32/90308_2.png) [@sonujatav35](https://discuss.elastic.co/u/sonujatav35)\
**Post date:** [June 26, 2023, 5:48am UTC](https://discuss.elastic.co/t/reindex-error-in-version6-after-upgrading-it-from-esv5/336529/7 "2023-06-26T05:48:58Z")

</div>

@dadoonet I tried this approach and seems like index not found error i was getting.  
I followed this [page](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html#reindex-from-remote) added remote server info to ES.yml file on source side where i have lower ES version(v5.6) and setup ES on destination side with(v8.7).

After that executed remote index api on the source side, but it was not working.

Is this the correct way to use remote index api and Is it possible to use between v5.6 and v8.7

Thanks

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 24, 2023, 10:27am UTC](https://discuss.elastic.co/t/reindex-error-in-version6-after-upgrading-it-from-esv5/336529/9 "2023-07-24T10:27:03Z")

</div>

> [@sonujatav35](#):
>
> After that executed remote index api on the source side, but it was not working.

What is the error message?
