Reindex error in version6 after upgrading it from ESv5

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?

{
"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:

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

Thanks
Sonu

Change this part:

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

Use the double.

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

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

{
  "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

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

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.

1 Like

@dadoonet I tried this approach and seems like index not found error i was getting.
I followed this page 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

What is the error message?