Resolving “Rejecting mapping update” issue when Migrating Elasticsearch 6 to 7

When migrating an ELK Cluster from Self-Hosted to Cloud hosted using this guide. I received the below error, this is due to changes made in Elasticsearch 7 to the “Document_Type” field. More info here.

Error:

{ _index: 'example-index-2019-11-01',
_type: 'doc',
_id: '123123123123123123123',
status: 400,
error:
{ type: 'illegal_argument_exception',
reason:
'Rejecting mapping update to [example-index-2019-11-01] as the final mapping would have more than 1 type: [_doc, doc]' } }

To resolve this issue, you can update the elasticdump command to specify the document type in the output:

for index in $(curl -GET 'localhost:9200/_cat/indices/*?v&s=index' | grep -v "kibana" | awk {'print $3'}); do elasticdump --input=http://localhost:9200/"$index" --output=https://elasticdump:[email protected]nd.io:9243/"$index"/_doc --limit=5000; done

Obviously adjust the “_doc” suffix on the output to match the document type used in your current Elasticsearch Cluster.

Any comments or questions? Get in touch here or Email me at [email protected]