# I created s3 repository for snapshot and restore but unable to restore it using created snapshot?

**URL:** <https://discuss.elastic.co/t/i-created-s3-repository-for-snapshot-and-restore-but-unable-to-restore-it-using-created-snapshot/111974>\
**Category:** Elasticsearch\
**Created:** [December 15, 2017, 11:57am UTC](https://discuss.elastic.co/t/i-created-s3-repository-for-snapshot-and-restore-but-unable-to-restore-it-using-created-snapshot/111974 "2017-12-15T11:57:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinayak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vinayak/32/45342_2.png) [@vinayak](https://discuss.elastic.co/u/vinayak)\
**Post date:** [December 15, 2017, 11:57am UTC](https://discuss.elastic.co/t/i-created-s3-repository-for-snapshot-and-restore-but-unable-to-restore-it-using-created-snapshot/111974/1 "2017-12-15T11:57:11Z")

</div>

Query for creating s3 repository:

```
PUT /_snapshot/s3_repository?verify=false
{
  "type": "s3",
  "settings": {
    "bucket": "appneura-elasticsearch-snapshot-backup",
    "region": "us-west-2",
    "access_key": " ********",
    "secret_key": " ********"
  }
}

```

**Note: I can use elasticsearch-keystore also for security purpose to mention "access\_key" & "secret\_key"**

Output for above query is:

```
{
  "acknowledged": true
}

```

After creating repository, i have created a snapshot using this query:

```
PUT /_snapshot/s3_repository/alerttrial?pretty&wait_for_completion=true
{

   "indices": "alertbrowser",  

   "ignore_unavailable": true,

   "include_global_state": false

}

```

After creating snapshot, i checked the status of created snapshot using query as:

`GET /_snapshot/s3_repository/alerttrial`

and output is as follows:

```
    {
      "snapshots": [
        {
          "snapshot": "alerttrial",
          "uuid": "yd6VMruSSQ6Hlx6o-GWjww",
          "version_id": 5050299,
          "version": "5.5.2",
          "indices": [
            "alertbrowser"
          ],
          "state": "SUCCESS",
          "start_time": "2017-12-15T11:39:09.834Z",
          "start_time_in_millis": 1513337949834,
          "end_time": "2017-12-15T11:46:24.856Z",
          "end_time_in_millis": 1513338384856,
          "duration_in_millis": 435022,
          "failures": [],
          "shards": {
            "total": 5,
            "failed": 0,
            "successful": 5
          }
        }
      ]
    }

```

As the above output is clearly indicating that inside repository with this **"uuid": "yd6VMruSSQ6Hlx6o-GWjww"** a snapshot has been created successfully.

Now after that i close that index first using this query:  
`POST /alertbrowser/_close`

After closing index, i want to do restore from created snapshot, for that i have use this query:

```
POST /_snapshot/s3_repository/alerttrial/_restore
{

    "indices": "index_1_alert_snap",

    "ignore_unavailable": true

}

```

result of this query is as follows:

```
{
  "snapshot": {
    "snapshot": "alerttrial",
    "indices": [],
    "shards": {
      "total": 0,
      "failed": 0,
      "successful": 0
    }
  }
}

```

it is not restroing data to mention index (index\_1\_alert\_snap). So where i am doing mistake or what i am missing, please tell me.If required i can paste a s3 bucket IAM console policy also.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [December 15, 2017, 12:10pm UTC](https://discuss.elastic.co/t/i-created-s3-repository-for-snapshot-and-restore-but-unable-to-restore-it-using-created-snapshot/111974/2 "2017-12-15T12:10:17Z")

</div>

It looks to me like you are trying to restore an index you did not include in the snapshot.

---

<div class="post-metadata">

**Author:** ![vinayak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vinayak/32/45342_2.png) [@vinayak](https://discuss.elastic.co/u/vinayak)\
**Post date:** [December 15, 2017, 12:57pm UTC](https://discuss.elastic.co/t/i-created-s3-repository-for-snapshot-and-restore-but-unable-to-restore-it-using-created-snapshot/111974/3 "2017-12-15T12:57:45Z")

</div>

Yes, correct.Thanx. Thats silly me........😛

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 12, 2018, 12:57pm UTC](https://discuss.elastic.co/t/i-created-s3-repository-for-snapshot-and-restore-but-unable-to-restore-it-using-created-snapshot/111974/4 "2018-01-12T12:57:51Z")

</div>

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