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

Trying to restore elastic search backup from 2.3.0 to 5.6.0

Following the below steps:

  1. update elasticsearch.yml file.

Added path.repo: ["C:/backup_elasticsearch_2_3_0"]

  1. Run below command for backup from the postman

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

  3. Download the elastic search 5.6.0

  4. updated elasticsearch.yml file.

Added path.repo: ["C:/backup_elasticsearch_2_3_0"]

started it.

  1. run this query from the postman

    POST localhost:9200/_snapshot/eventindexbackup/22aug18/_restore
    

I am getting below error:

{
    "error": {
        "root_cause": [
            {
                "type": "repository_missing_exception",
                "reason": "[eventindexbackup] missing"
            }
        ],
        "type": "repository_missing_exception",
        "reason": "[eventindexbackup] missing"
    },
    "status": 404`enter code here`
}

Do I need to create the snapshot in 5.6.0 elastic search? Am I following the wrong steps? Please provide me the correct steps.

You need to execute step 2a again on your 5.6 cluster, to register your repository with your new Elasticsearch 5.6 cluster.

I also did, but I am still getting

		{
			"error": {
				"root_cause": [
					{
						"type": "snapshot_restore_exception",
						"reason": "[eventindexbackup:22aug18]snapshot does not exist"
					}
				],
				"type": "snapshot_restore_exception",
				"reason": "[eventindexbackup:22aug18]snapshot does not exist"
			},
			"status": 500
		}

What is the output of:

GET /_snapshot/eventindexbackup/_all

Does it list the 22aug18 snapshot? If it does, what is the output of:

GET /_snapshot/eventindexbackup/22aug18/_status

When I execute this command "localhost:9200/_snapshot/eventindexbackup/_all" for elastic search 2.3.0

I got result:

    {
        "snapshots": [
            {
                "snapshot": "22aug18",
                "version_id": 2020199,
                "version": "2.2.1",
                "indices": [
                    "event-2018.08.21"
                ],
                "state": "SUCCESS",
                "start_time": "2018-08-22T07:19:41.496Z",
                "start_time_in_millis": 1534922381496,
                "end_time": "2018-08-22T07:19:41.673Z",
                "end_time_in_millis": 1534922381673,
                "duration_in_millis": 177,
                "failures": [],
                "shards": {
                    "total": 5,
                    "failed": 0,
                    "successful": 5
                }
            }
        ]
    }

but for elastic search 5.6.0:

    {
        "snapshots": []
    }

I have tried to reproduce your issue, but everything works fine on my machine. Can you try registering your repository as read-only on your 5.6 cluster? The docs state that: "The snapshot format can change across major versions, so if you have clusters on different major versions trying to write the same repository, new snapshots written by one version will not be visible to the other. "

PUT _snapshot/eventindexbackup
{
  "type": "fs",
  "settings": {
    "location": "eventindex",
    "compress": "true",
    "readonly": true
  }
}

And next try to see if the snapshot shows up:

GET /_snapshot/eventindexbackup/_all

I executed below command for Elasticsearch 5.6.0

PUT localhost:9200/_snapshot/eventindexbackup
{
  "type": "fs",
  "settings": {
    "location": "eventindex",
    "compress": "true",
    "readonly": true
  }
}

Then I tried

GET /_snapshot/eventindexbackup/_all

I got the same response:
{
    "snapshots": []
}

I'm not sure what's going on here.

Can you double check that you have no typo in your 5.6 elasticsearch.yml file for the path.repo setting?

What files do you see in the C:\backup_elasticsearch_2_3_0\eventindex directory?

dir C:\backup_elasticsearch_2_3_0\eventindex

Thanks, Abdon
I am able to resolve it.
I was using

path.repo: ["C:/backup_elasticsearch_2_3_0"]

but when I used

path.repo: ["C:\\backup_elasticsearch_2_3_0"]

It is working fine.

But I noticed that indices is restored in elasticsearch 5.6.0 with some dummy name instead of "event-YYYY.MM.DD"

Hi @abdon

I was taking the backup indices from AWS elasticSearch to S3 bucket.

With the help of below link, I am successfully able to take the back

But I noticed that name of indices folder has changed on s3 bucket. It is some random name, instead of event-2018.08.21.
Can you please help to resolve it.

Maybe you can share the exact request that you're sending to Elasticsearch 5.6 to restore the index?

What is the name of the restored index in 5.6?

I am using below command for backup

a. PUT localhost:9200/_snapshot/es-s3-repository
{
    "type": "s3",
    "settings": {
        "bucket": "es-s3-repository",
        "region": "us-west-2",
        "role_arn": "arn:aws:iam::123456789012:role/es-s3-repository"
    }
}

b. PUT localhost:9200/_snapshot/es-s3-repository/snapshot_1
{
  "indices": "event-*",
  "ignore_unavailable": true,
  "include_global_state": false
}

you will get more information from here:

The directory names do not correspond to index names. What happens if you restore these indices into your target cluster? The indexes should keep their original names then.

Hi @abdon
When I restored these indices into target, they stored with their original name.

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