Upgrade from OpenSearch 1.x to 2.x

Hi Team,

We had migrated from Elasticsearch 6.2 to OpenSearch 1.2.4 in our product by following the steps in opensearch documentation. As per the link we don’t have to do any reindexing . Now we are planning to upgrade to OpenSearch 2.5 from 1.2.4, do we need to do any reindexing before upgrading to 2.5.

Also, some versions of our product is still using ElasticSearch 6.2, if we had to directly migrate to OpenSearch 2.5, Shall we follow the same approach as we did for 1.2.4 migration ? Considering we might have indices created in 6.2 version

Thanks in advance

Regards,
Sarjoon

Hello Sarjoon and thanks for the great question!

Apache Lucene is backward compatible one major version (N-1), similar to OpenSearch. The quickest and easiest way to compare versions is to query the index(es) that you want to retain and determine which version of OpenSearch or Elasticsearch created them.

If you query the index (replace <index-name> with the name of the index):

curl "localhost:9200/<index-name>?human&pretty"

You will get a response similar to this. The important thing to look for is version.created_string which is 7.10.2 for this particular index.

{
  "ecommerce" : {
    "aliases" : { },
    "mappings" : { },
    "settings" : {
      "index" : {
        "creation_date_string" : "2023-02-16T18:20:48.711Z",
        "number_of_shards" : "1",
        "provided_name" : "ecommerce",
        "creation_date" : "1676571648711",
        "number_of_replicas" : "3",
        "uuid" : "Pu27RaFTTqK2FAjhDbwK7A",
        "version" : {
          "created_string" : "7.10.2",
          "created" : "7100299"
        }
      }
    }
  }
}

Once you have that information, you can do either of two things.

The first method is to check out the Lucene version reference on the new upgrade overview page. Elasticsearch 7.10.x uses Apache Lucene version 8.7.0, and OpenSearch 2.5.0 uses Lucene version 9.4.2. Apache Lucene is backward compatible a single (N-1) major version. So in this case, OpenSearch 2.5.0 should be compatible with indexes created by Elasticsearch 7.x or newer. Since 8.7.0 is in the previous major version of Lucene, then the index would be compatible.

The second method would be to check version.minimum_index_compatibility_version for the version. I did this by spinning up a Docker container on my laptop using the opensearch:2.5.0 image. Query the node with a command like this:

curl http://localhost:9200

You should see a response similar to this:

{
  "name" : "opensearch-node1-2-4",
  "cluster_name" : "opensearch-cluster-2-4",
  "cluster_uuid" : "BYGzWs8DT2GpFqAEbN9B_g",
  "version" : {
    "distribution" : "opensearch",
    "number" : "2.5.0",
    "build_type" : "tar",
    "build_hash" : "b8a8b6c4d7fc7a7e32eb2cb68ecad8057a4636ad",
    "build_date" : "2023-01-18T23:49:00.584806002Z",
    "build_snapshot" : false,
    "lucene_version" : "9.4.2",
    "minimum_wire_compatibility_version" : "7.10.0",
    "minimum_index_compatibility_version" : "7.0.0"
  },
  "tagline" : "The OpenSearch Project: https://opensearch.org/"
}

This tells us that OpenSearch 2.5.0 is compatible with indexes created by Elasticsearch 7.0.0 or newer.

I hope that is helpful. Please let me know if we can offer more guidance or clarify something.

Kind regards,
Jeff

2 Likes

There’s [DOCS-META] Version upgrade and migration documentation · Issue #2830 · opensearch-project/documentation-website · GitHub that attempts to capture this and other aspects of upgrading into our documentation. Please add your questions and comments!

3 Likes

Hi Jeff,

Thanks for the detailed response. Will check this out.

Sarjoon

1 Like

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