# Cannot open data from 5.x in 6.x : Mappings

**URL:** <https://discuss.elastic.co/t/cannot-open-data-from-5-x-in-6-x-mappings/250346>\
**Category:** Elasticsearch\
**Created:** [September 29, 2020, 11:18am UTC](https://discuss.elastic.co/t/cannot-open-data-from-5-x-in-6-x-mappings/250346 "2020-09-29T11:18:59Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![yBother](https://avatars.discourse-cdn.com/v4/letter/y/e274bd/32.png) [@yBother](https://discuss.elastic.co/u/yBother)\
**Post date:** [September 29, 2020, 11:18am UTC](https://discuss.elastic.co/t/cannot-open-data-from-5-x-in-6-x-mappings/250346/1 "2020-09-29T11:18:59Z")

</div>

I've created a routine that updates ES clients from 5.x to 6.x and finally 7.x  
Somehow some clients cannot be updated.  
Loading existing data in 6.8 fails.  
Appearently some mappings are causing this.  
But there are not templates applied and I cannot see any difference to the other clients, were everything works just fine.  
Do I have to apply some templates to the 5.x version and retry or what?

```auto
Caused by: org.elasticsearch.index.mapper.MapperParsingException: Failed to parse mapping [datapoint]: No handler for type [string] declared on field [batchId]

```

````auto
java.lang.IllegalStateException: unable to upgrade the mappings for the index [[eve/xGvLV_oqSXeT3BwXNQEeyQ]]
	at org.elasticsearch.cluster.metadata.MetaDataIndexUpgradeService.checkMappingsCompatibility(MetaDataIndexUpgradeService.java:205) ~[elasticsearch-6.8.8.jar:6.8.8]
	at org.elasticsearch.cluster.metadata.MetaDataIndexUpgradeService.upgradeIndexMetaData(MetaDataIndexUpgradeService.java:103) ~[elasticsearch-6.8.8.jar:6.8.8]
	at org.elasticsearch.gateway.GatewayMetaState.upgradeMetaData(GatewayMetaState.java:246) ~[elasticsearch-6.8.8.jar:6.8.8]
	at org.elasticsearch.gateway.GatewayMetaState.<init>(GatewayMetaState.java:89) [elasticsearch-6.8.8.jar:6.8.8]
	at org.elasticsearch.node.Node.<init>(Node.java:499) [elasticsearch-6.8.8.jar:6.8.8]
	at org.elasticsearch.node.Node.<init>(Node.java:266) [elasticsearch-6.8.8.jar:6.8.8]
	at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:212) [elasticsearch-6.8.8.jar:6.8.8]
	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:212) [elasticsearch-6.8.8.jar:6.8.8]
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) [elasticsearch-6.8.8.jar:6.8.8]
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) [elasticsearch-6.8.8.jar:6.8.8]
	at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) [elasticsearch-6.8.8.jar:6.8.8]
	at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) [elasticsearch-6.8.8.jar:6.8.8]
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) [elasticsearch-cli-6.8.8.jar:6.8.8]
	at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-cli-6.8.8.jar:6.8.8]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:116) [elasticsearch-6.8.8.jar:6.8.8]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) [elasticsearch-6.8.8.jar:6.8.8]
Caused by: org.elasticsearch.index.mapper.MapperParsingException: Failed to parse mapping [datapoint]: No handler for type [string] declared on field [batchId]
	at org.elasticsearch.index.mapper.MapperService.internalMerge(MapperService.java:399) ~[elasticsearch-6.8.8.jar:6.8.8]
	at org.elasticsearch.index.mapper.MapperService.internalMerge(MapperService.java:355) ~[elasticsearch-6.8.8.jar:6.8.8]
	at org.elasticsearch.index.mapper.MapperService.merge(MapperService.java:334) ~[elasticsearch-6.8.8.jar:6.8.8]
	at org.elasticsearch.cluster.metadata.MetaDataIndexUpgradeService.checkMappingsCompatibility(MetaDataIndexUpgradeService.java:201) ~[elasticsearch-6.8.8.jar:6.8.8] ```
````

---

<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:** [September 29, 2020, 12:19pm UTC](https://discuss.elastic.co/t/cannot-open-data-from-5-x-in-6-x-mappings/250346/2 "2020-09-29T12:19:18Z")

</div>

Sounds like you are trying to define a field `datapoint` as a `string` which is not supported anymore and must be a `text` or a `keyword`.

---

<div class="post-metadata">

**Author:** ![yBother](https://avatars.discourse-cdn.com/v4/letter/y/e274bd/32.png) [@yBother](https://discuss.elastic.co/u/yBother)\
**Post date:** [September 29, 2020, 12:26pm UTC](https://discuss.elastic.co/t/cannot-open-data-from-5-x-in-6-x-mappings/250346/3 "2020-09-29T12:26:57Z")

</div>

hm actually /\_mappings states:  
`"batchId":{"type":"keyword"},`  
the term 'string' does not exist in my mapping response...

---

<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:** [September 29, 2020, 2:12pm UTC](https://discuss.elastic.co/t/cannot-open-data-from-5-x-in-6-x-mappings/250346/4 "2020-09-29T14:12:26Z")

</div>

The field name is `datapoint` not `batchId`.

I'm not sure about what you are doing but may be you are trying to call the update mapping API?

> unable to upgrade the mappings for the index `eve`

---

<div class="post-metadata">

**Author:** ![yBother](https://avatars.discourse-cdn.com/v4/letter/y/e274bd/32.png) [@yBother](https://discuss.elastic.co/u/yBother)\
**Post date:** [September 29, 2020, 3:48pm UTC](https://discuss.elastic.co/t/cannot-open-data-from-5-x-in-6-x-mappings/250346/5 "2020-09-29T15:48:28Z")

</div>

> [@dadoonet](#):
>
> The field name is `datapoint` not `batchId` .

Really? That cannot be true: **datapoint** is the entity not a field. Also the error states:

_No handler for type [string] declared on **field** [batchId]_

I am just starting the elasticsearch.bat file in 6.8.8 in order to reindex data

![grafik](https://us1.discourse-cdn.com/elastic/original/3X/2/4/244865ea3053f424f1cf9e8ed2f89fe9938b11f4.png)

---

<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:** [September 30, 2020, 9:55am UTC](https://discuss.elastic.co/t/cannot-open-data-from-5-x-in-6-x-mappings/250346/6 "2020-09-30T09:55:10Z")

</div>

Ha right. Sorry for the confusion.

So everything is correct in term of existing mapping.

But something is calling the Update Mapping API with a wrong schema.

---

<div class="post-metadata">

**Author:** ![yBother](https://avatars.discourse-cdn.com/v4/letter/y/e274bd/32.png) [@yBother](https://discuss.elastic.co/u/yBother)\
**Post date:** [October 1, 2020, 9:08am UTC](https://discuss.elastic.co/t/cannot-open-data-from-5-x-in-6-x-mappings/250346/7 "2020-10-01T09:08:16Z")

</div>

> [@dadoonet](#):
>
> But something is calling the Update Mapping API with a wrong schema.

It seems so but the only thing I do is executing elasticsearch.bat

---

<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:** [October 1, 2020, 9:27am UTC](https://discuss.elastic.co/t/cannot-open-data-from-5-x-in-6-x-mappings/250346/8 "2020-10-01T09:27:18Z")

</div>

> It seems so but the only thing I do is executing elasticsearch.bat

Probably you need to explain what you exactly did:

> [@yBother](#):
>
> I've created a routine that updates ES clients from 5.x to 6.x and finally 7.x  
> Somehow some clients cannot be updated.  
> Loading existing data in 6.8 fails.

When upgrading to a major version, you must go through all the steps which are documented at

> **[Upgrade Elasticsearch | Elasticsearch Guide \[6.8\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/6.8/setup-upgrade.html)**

I'd recommend also trying

> **[Upgrade to Elastic 8.11.1 | Elastic Installation and Upgrade Guide \[8.11\] |...](https://www.elastic.co/guide/en/elastic-stack/current/upgrading-elastic-stack.html)**

Once you'll have finish to 6.8 upgrade, I'll recommend you using Kibana and the upgrade assistant to prepare your cluster to 7.9.

May be an easier path to this is to reindex the data in the 7.9 cluster "directly".

---

<div class="post-metadata">

**Author:** ![yBother](https://avatars.discourse-cdn.com/v4/letter/y/e274bd/32.png) [@yBother](https://discuss.elastic.co/u/yBother)\
**Post date:** [October 1, 2020, 2:00pm UTC](https://discuss.elastic.co/t/cannot-open-data-from-5-x-in-6-x-mappings/250346/9 "2020-10-01T14:00:39Z")

</div>

Well the procedure is like suggested:

> **[Reindex before upgrading | Elasticsearch Reference \[7.9\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/reindex-upgrade.html)**

6.x should be able to load 5.x data. And I can tellt that this seems to be correct in general because that's what I always do.  
The thing is that in this particular case, 6.x simply cannot load the data.

---

<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:** [October 1, 2020, 2:23pm UTC](https://discuss.elastic.co/t/cannot-open-data-from-5-x-in-6-x-mappings/250346/10 "2020-10-01T14:23:59Z")

</div>

Could you share what is the exact output of

```auto
GET /

```

When you are running the cluster in version 5?

---

<div class="post-metadata">

**Author:** ![yBother](https://avatars.discourse-cdn.com/v4/letter/y/e274bd/32.png) [@yBother](https://discuss.elastic.co/u/yBother)\
**Post date:** [October 1, 2020, 2:43pm UTC](https://discuss.elastic.co/t/cannot-open-data-from-5-x-in-6-x-mappings/250346/11 "2020-10-01T14:43:06Z")

</div>

{  
"name" : "U9QKykR",  
"cluster\_name" : "elasticsearch",  
"cluster\_uuid" : "G0uiXeQURmqXJwy5OB\_agQ",  
"version" : {  
"number" : "5.2.2",  
"build\_hash" : "f9d9b74",  
"build\_date" : "2017-02-24T17:26:45.835Z",  
"build\_snapshot" : false,  
"lucene\_version" : "6.4.1"  
},  
"tagline" : "You Know, for Search"  
}

---

<div class="post-metadata">

**Author:** ![yBother](https://avatars.discourse-cdn.com/v4/letter/y/e274bd/32.png) [@yBother](https://discuss.elastic.co/u/yBother)\
**Post date:** [October 1, 2020, 2:59pm UTC](https://discuss.elastic.co/t/cannot-open-data-from-5-x-in-6-x-mappings/250346/12 "2020-10-01T14:59:10Z")

</div>

I just came across another thing regarding forbidden characters in field names which appearently can also lead to this exception.

I found out that there is a difference in the actual data structure of the affected client.  
It has additional parameters, that should not exist anymore.

"batchName" : "ECB2018 (3)",  
"parameterName" : "Foam",  
"phaseName" : "",  
"deviceName" : "Minifors 2",  
"deviceType" : "Minifors2"

Could this be somehow an issue?

---

<div class="post-metadata">

**Author:** ![yBother](https://avatars.discourse-cdn.com/v4/letter/y/e274bd/32.png) [@yBother](https://discuss.elastic.co/u/yBother)\
**Post date:** [October 3, 2020, 3:40pm UTC](https://discuss.elastic.co/t/cannot-open-data-from-5-x-in-6-x-mappings/250346/13 "2020-10-03T15:40:51Z")

</div>

Okay problem solved.  
There was an index that wasn't supposed to be there. After deleting it, ES 6.8 starts up as expected.

---

<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:** [October 31, 2020, 3:40pm UTC](https://discuss.elastic.co/t/cannot-open-data-from-5-x-in-6-x-mappings/250346/14 "2020-10-31T15:40:58Z")

</div>

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