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:
- update elasticsearch.yml file of elastic search 5.6.0.
Added path.repo: ["C:\apps\backup_elasticsearch_5_6_0"]
-
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
-
Stop the elastic search.
-
Download the elastic search 6.3.0
-
updated elasticsearch.yml file.
Added path.repo: ["C:\apps\backup_elasticsearch_5_6_0"]
started it.
-
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
}