Restore snapshot

I see this command in help site
https://www.elastic.co/guide/en/elasticsearch/reference/current/snapshots-restore-snapshot.html

POST /_snapshot/my_backup/snapshot_1/_restore

But I am missing the prerequisite steps.
Here is my situation -

  1. I have a working Elasticsearch setup in my Windows PC. I can run POST, GET commands and follow tutorials.

  2. I have now received a snapshot of some other working setup (unix). I can restore the tar file in unix system and copy files/folders over to my local disk in PC. But what is not clear is where should I place that folder and how should I mention that folder name in above POST command.

Can you please check and advise?

Thank you

@dadoonet - Can you please check this post? There is no response for quite some time. Thank you.

I read up about snapshot/restore from a book (Elasticsearch - Definitive Guide, older edition). And tried this additional steps.

POST /_snapshot/mybackup/snapshot_1/_restore
{
"type" : "fs",
"settings" : {
"location" : "C:\Elasticsearch\mybackup"
}
}

I get this error -

{
"error": {
"root_cause": [
{
"type": "json_parse_exception",
"reason": "Unrecognized character escape 'E' (code 69)\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@423cb275; line: 4, column: 23]"
}
],
"type": "json_parse_exception",
"reason": "Unrecognized character escape 'E' (code 69)\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@423cb275; line: 4, column: 23]"
},
"status": 500
}

Please format your code, logs or configuration files using </> icon as explained in this guide and not the citation button. It will make your post more readable.

Or use markdown style like:

```
CODE
```

This is the icon to use if you are not using markdown format:

There's a live preview panel for exactly this reasons.

Lots of people read these forums, and many of them will simply skip over a post that is difficult to read, because it's just too large an investment of their time to try and follow a wall of badly formatted text.
If your goal is to get an answer to your questions, it's in your interest to make it as easy to read and understand as possible.

Have a look at the documentation about windows paths: https://www.elastic.co/guide/en/elasticsearch/reference/current/snapshots-register-repository.html#snapshots-filesystem-repository

    Thank you David.

    I did two extra steps. One to register the new Windows location by adding path.repo in yml file.
    Restarted elasticsearch after changing yml file.

    Also registered using the following (used escape character for windows location)

```
    PUT /_snapshot/xyz
    {
      "type" : "fs",
      "settings" : {
        "location" : "C:\\Elasticsearch\\xyz"
      }
    }
```
    That seems to have worked.

    But the RESTORE step still fails.

```
    POST /_snapshot/xyz/snapshot_1/_restore
    {
      "type" : "fs",
      "settings" : {
        "location" : "C:\\Elasticsearch\\xyz"
      }
    }
```

    Here is the error -
```
    {
      "error": {
        "root_cause": [
          {
            "type": "illegal_argument_exception",
            "reason": "Unknown parameter type"
          }
        ],
        "type": "illegal_argument_exception",
        "reason": "Unknown parameter type"
      },
      "status": 400
    }
```

    Can you please check and advise?

    Thank you

Your post still look malformed.

Anyway, please read the documentation about restore: https://www.elastic.co/guide/en/elasticsearch/reference/current/snapshots-restore-snapshot.html
The API does not use the same parameters as the create repository api.

Thanks @dadoonet for prompt response. The following command seems to work for restore (as I do not get syntax error). However, I get version mismatch issue and I need to get back to the provider of the snapshot. As far as I can see, there are 3 steps for restore.

  1. Configure (add path.repo in yml file)
  2. Register the copied snapshot foider
  3. Resore

You may close the ticket now.

Thank you

Debasis

POST /_snapshot/xyz/snapshot_1/_restore

May be you have old segments that have been created in a previous major version?

If you need help, feel free to open a new question and share the full error message.

Once I downgraded to version 7.3.2 (matching with provider of snapshot in my case), all 3 steps worked properly. I shall create new ticket if and when I have more issues. Thank you

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