Skip to main content

Upgrade Elasticsearch clients to OpenSearch®

Elasticsearch has introduced breaking changes into their client libraries as early as 7.13.*, meaning newer Elasticsearch clients won't work with OpenSearch®.

Migration steps

To upgrade the Elasticsearch clients to OpenSearch:

  1. Pin your Elasticsearch libraries to version 7.10.2 (latest version under the open-source license).
  2. Switch from Elasticsearch 7.10.2 to the fully compatible OpenSearch 1.0.0.
  3. Update OpenSearch libraries till their latest version.
note

You can migrate your cluster from Elasticsearch to OpenSearch either before or after switching the clients.

Postpone the upgrade

If you cannot upgrade immediately, we recommend locking the client version of Elasticsearch to 7.10.2 and use this version till you can proceed with the migration steps outlined above. This is true for application libraries as well as for the supporting ecosystem of tooling like File Beats and Logstash.

note

See OpenSearch compatibility documentation as the source of truth.

Client migration examples

To help you with the migration, see some code migration examples.

Java and Spring Boot

Java client is a fork of the Elasticsearch library. To migrate change the Maven or Gradle dependencies, and update the import statements for the DOA layer. See an example code change in our repository.

NodeJS

Node library is a fork of the Elasticsearch library. The only required change should be the dependency in package.json and the require or import statements. See an example migration code in our repository.

Python

Python client library is a fork of the Elasticsearch libraries. The only required change should be the dependencies and the require or import statements. See an example migration code in our repository.

Elasticsearch is a trademark of Elasticsearch B.V., registered in the U.S. and in other countries.