Opensearch rollback(downgrade) to lower version

Versions (relevant - OpenSearch): Opensearch 2.6.0

Describe the issue: I was trying to upgrade the OpenSearch from Version 1.3.x to Opensearch 2.6.0 version

As part of our organization use case, we need to deliver the Install/upgrade/rollback feature. but when we try to downgrade the opensearch from higher version to lower version then we could nt restore the snapshot which has been taken from higher version to lower version

We are getting the below exception when we try to restore the snapshot

> POST "/_snapshot/repository/1/_restore?pretty"
> {
>   "error" : {
>     "root_cause" : [
>       {
>         "type" : "snapshot_restore_exception",
>         "reason" : "[repository:1/KJHRb6oFRjqlulc5Q_0yOQ] the snapshot was created with OpenSearch version [2.6.0] which is higher than the version of this node [1.3.8]"
>       }
>     ],
>     "type" : "snapshot_restore_exception",
>     "reason" : "[repository:1/KJHRb6oFRjqlulc5Q_0yOQ] the snapshot was created with OpenSearch version [2.6.0] which is higher than the version of this node [1.3.8]"
>   },
>   "status" : 500
> }

Could you please help us to solve this problem. is there any way to avoid this exception.

Configuration:

Relevant Logs or Screenshots:

Hi @RAGURAMAN

As per the documentation below, snapshots are only forward-compatible by one major version:

In order to copy your data from the OpenSearch version 2.6.0 to the OpenSearch version 1.3.x, you can use reindex API:

1 Like

Hi @Eugene7 ,

We tried reindexing the data from OpenSearch 2.7.0 (remote) to OpenSearch 1.2.4 (local).
But we’re getting this error.

$ curl -X POST "127.0.0.1:1240/_reindex?pretty" -H 'Content-Type: application/json' -d '
{
   "source":{
      "remote":{
         "host":"http://127.0.0.1:2700/"
      },
      "index": "test"
   },
   "dest":{
      "index":"test"
   }
}'
{
  "error" : {
    "root_cause" : [
      {
        "type" : "exception",
        "reason" : "Error parsing the response, remote is likely not an OpenSearch instance"
      }
    ],
    "type" : "exception",
    "reason" : "Error parsing the response, remote is likely not an OpenSearch instance",
    "caused_by" : {
      "type" : "x_content_parse_exception",
      "reason" : "[4:13] [search_response] failed to parse field [hits]",
      "caused_by" : {
        "type" : "x_content_parse_exception",
        "reason" : "[4:13] [hits] failed to parse field [hits]",
        "caused_by" : {
          "type" : "illegal_argument_exception",
          "reason" : "Required [_type]"
        }
      }
    }
  },
  "status" : 500
}

NOTE: OpenSearch 1.2.4 is running in localhost:1240 and OpenSearch 2.7.0 is running in localhost:2700.

Hi @manoj,

Could you share your opensearch.yml files for the OpenSearch 2.7.0 cluster and the OpenSearch 1.2.4 cluster ?

Hi @Eugene7 ,

Please find below the opensearch.yaml files for both versions of OpenSearch.

opensearch.yml for OpenSearch 1.2.4

cluster.name: opensearch-124
node.name: node-124
network.host: 127.0.0.1
node.roles: [ data, ingest, master, remote_cluster_client ]
http.port: 1240
discovery.seed_hosts: ["127.0.0.1"]
cluster.initial_master_nodes: ["node-124"]
reindex.remote.whitelist: '127.0.0.1:2700'

And,
opensearch.yml for OpenSearch 2.7.0

cluster.name: opensearch-270
node.name: node-270
network.host: 127.0.0.1
node.roles: [ data, ingest, master, remote_cluster_client ]
http.port: 2700
discovery.seed_hosts: ["127.0.0.1"]
cluster.initial_master_nodes: ["node-270"]
reindex.remote.whitelist: '127.0.0.1:1240'

Hey @manoj

I noticed you had the same issue as myself. I had to do something like this

curl -X POST "localhost:9200/_reindex?pretty" -H 'Content-Type: application/json' -d'
{
  "source": {
    "index": "my-index-000001"
  },
  "dest": {
    "index": "my-new-index-000001"
  }
}
'

Hi @Gsmitt ,

I need to reindex from a remote cluster(which has OpenSearch 2.7.0) to local cluster(which has OpenSearch 1.24)

hey @manoj

I understand, Question using 127.0.0.1 OR localhost how do you connect to a remote host?
What I have done to achieve something like this is using an IP Address from the remote host, because 127.0.0.1 /Localhost really doesn’t work when executing commands to a remote destination.

Hi @Gsmitt ,
I’m running both versions of OpenSearch in same machine, but in different ports (1240 and 2700).
So, OpenSearch 1.2.4 can be accessed via localhost:1240 and 127.0.0.1:1240. And OpenSearch 2.7.0 can be accessed via localhost:2700 and 127.0.0.1:2700

Hey ,

Oh I see, Gotcha
EDIT: What Isee above.

Have you tried to reindex to a different index set? Something like this.

{
  "source": {
    "index": "test"
  },
  "dest": {
    "index": "test-001"
  }
}
'

Hi,
Yeah. Tried that one too.
Still same issue.
Is it anything to do with the breaking change in version 2.x ?

Removal of _type field.

Not sure @manoj ,

I learned that leason long time ago with Elasticsearch-6.0.x, is that you can upgrade major version but difficult to downgrade that major verion of ES and/or OS.

Sorry I cant be more help,

yeah @Gsmitt
I’m trying to achieve that somehow :slightly_smiling_face:
Reindexing is happening between 1.x versions and between 2.x versions.
And even from 1.x to 2.x.
But it’s not happening from 2.x to 1.x

1 Like

If you get it to work, I would really like to know how yto achieve this.

1 Like