Restore-elastic-search-snapshot-from-2-2-1-to-6-3-0

I read that we can directly upgrade indices from 2.2.1 to 6.3.0.
So First I upgraded it from 2.2.1 to 5.6.0

Now I am Trying to restore elastic search backup from 5.6.0 to 6.3.0

Following the below steps:

  1. update elasticsearch.yml file of elastic search 5.6.0.

Added path.repo: ["C:\apps\backup_elasticsearch_5_6_0"]

  1. Run below command for backup from the postman

    a.  PUT localhost:9200/_snapshot/eventindexbackup_new
    
          { "type": "fs", "settings": { "location": "eventindex", "compress": "true" } }
    
    b. PUT localhost:9200/_snapshot/eventindexbackup_new/22aug18
    
        { "indices": "event*", "ignore_unavailable": true, "include_global_state": false }
    
    c. To check, a snapshot is created or not:
    
        GET localhost:9200/_snapshot/eventindexbackup_new/22aug18
    
  2. Stop the elastic search.

  3. Download the elastic search 6.3.0

  4. updated elasticsearch.yml file.

Added path.repo: ["C:\apps\backup_elasticsearch_5_6_0"]

started it.

  1. run this query from the postman

    a. PUT localhost:9200/_snapshot/eventindexbackup_new
       { "type": "fs",  "settings": {	"location": "eventindex",	"compress": "true",	"readonly": true  }}
    b.  GET localhost:9200/_snapshot/eventindexbackup_new/_all
    

its response is:

{
    "snapshots": [
        {
            "snapshot": "22aug18",
            "uuid": "tULkPvm2RrSFNVxK8MgZcA",
            "version_id": 5060099,
            "version": "5.6.0",
            "indices": [
                "event-2018.08.21"
            ],
            "state": "SUCCESS",
            "start_time": "2018-08-22T09:59:00.470Z",
            "start_time_in_millis": 1534931940470,
            "end_time": "2018-08-22T09:59:00.668Z",
            "end_time_in_millis": 1534931940668,
            "duration_in_millis": 198,
            "failures": [],
            "shards": {
                "total": 5,
                "failed": 0,
                "successful": 5
            }
        }
    ]
}
c. POST localhost:9200/_snapshot/eventindexbackup_new/22aug18/_restore

I am getting below error:

{
    "error": {
        "root_cause": [
            {
                "type": "snapshot_restore_exception",
                "reason": "[eventindexbackup_new:22aug18/tULkPvm2RrSFNVxK8MgZcA] cannot restore index [event-2018.08.21] because it cannot be upgraded"
            }
        ],
        "type": "snapshot_restore_exception",
        "reason": "[eventindexbackup_new:22aug18/tULkPvm2RrSFNVxK8MgZcA] cannot restore index [event-2018.08.21] because it cannot be upgraded",
        "caused_by": {
            "type": "illegal_state_exception",
            "reason": "The index [[event-2018.08.21/LMWhXJBKSXangg6G704IQA]] was created with version [2.2.1] but the minimum compatible version is [5.0.0]. It should be re-indexed in Elasticsearch 5.x before upgrading to 6.3.0."
        }
    },
    "status": 500
}

Why open a new issue where there as far as I can see already exists one tracking this here?

Hi @Christian_Dahlqvist
This is different one.
Here I am restoring from 2.2.1 to 6.3.0

Indices created in Elasticsearch 2.x can not be read by Elasticsearcg 6.x, so that is unlikely to work. You either need to go via Elasticsearch 5.6 or reindex the data from remote.

I did the same.
First I took the backup of indices of elastic search 2.2.1 and restore it in 5.6.0
Then again took the backup of indices of elastic search 5.6.0 and trying to restore it in 6.3.0.

Is that not what is described in the other issue? I still do not understand how this is different...

Hi @Christian_Dahlqvist

Could you please provide me proper steps to restore the indices from elastic search 2.2.1 to 6.3.0 via elastic search 5.6.0 .

What in the documentation is not working or not clear? Have you seen this upgrade guide?

Thanks @Christian_Dahlqvist
I am able to migrate it.

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