+++
title = "Upgrading to Elasticsearch Version 6"
weight = 24
updated = 2023-06-17
aliases = ["/docs/upgrading-to-es-6", "/docs/managed-search/elasticsearch-and-opensearch/cluster-management/version-upgrades/guides/upgrading-to-elasticsearch-version-6/"]

[extra]
nav_title = "Upgrading to ES Version 6"
weight = 20
+++

{% admonition(type="info", title="Important") %}
This document serves to highlight key breaking changes for our customers. It
does not represent the full list of breaking changes. As always, we recommend
you test your searches on the new version of Elasticsearch before moving
forward.
{% end %}

Elasticsearch 6 has a stand-out breaking change, which is the limitation of only
one mapping type per index. This is due to the upcoming removal of [mapping
types](https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html). Before this version all versions of Elasticsearch supported the concept
of multiple mapping types, which would let you store different "types" of data
in one index. Elastic is removing this feature in ES 7 after announcing its
deprecation in ES 6.

## General Solutions

* Rename all remaining mapping types to `_doc` to align with the future default
* Use 1 index per document type.

This has been the standard recommendation for the best performance in
Elasticsearch since its inception. Rather than index multiple types of documents
into a single index, simply use one index per document type. Many tools and
frameworks supporting Elasticsearch will do this for you automatically.

## Custom Type Field

For those times when it simply doesn't make sense to have one document type per
index, you can add a dedicated field to the document that declares a document's
given type. Then when you query on that index you will simply pass in which type
you want the query limited to as well.

## From 5.x

After working through the General Solutions above, we recommend you do the
following:

* upgrading to at least v5.6 and then turning on `index.mapping.single_type: true`
to verify you haven't missed anything.

## From 2.x

There are no specific tricks for this upgrade process, outside of the General
Solution listed above. We would simply recommend you follow
our [traditional process](@/docs/cluster-management/version-upgrades/upgrading-major-versions/index.md) for
testing your searches on a new version of Elasticsearch. In short, this involves
provisioning a new 6.x cluster and validating it in a development environment.
Once it has been validated, proceed with the production upgrade.

## From 1.x

There are no specific tricks for this upgrade process, outside of the General
Solution listed above. We would simply recommend you follow
our [traditional process](@/docs/cluster-management/version-upgrades/upgrading-major-versions/index.md) for
testing your searches on a new version of Elasticsearch.