# Restoring a snapshot from a remote repository

**URL:** <https://discuss.elastic.co/t/restoring-a-snapshot-from-a-remote-repository/75378>\
**Category:** Elasticsearch\
**Created:** [February 16, 2017, 5:14pm UTC](https://discuss.elastic.co/t/restoring-a-snapshot-from-a-remote-repository/75378 "2017-02-16T17:14:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![guilherme\_maranhao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guilherme_maranhao/32/101483_2.png) [@guilherme\_maranhao](https://discuss.elastic.co/u/guilherme_maranhao)\
**Post date:** [February 16, 2017, 5:14pm UTC](https://discuss.elastic.co/t/restoring-a-snapshot-from-a-remote-repository/75378/1 "2017-02-16T17:14:57Z")

</div>

Hi all,

I set a local repository with type: "url" to access a remote repository.

PUT localhost:9200/\_snapshot/elastic\_backup

```
{
   "type": "url",
   "settings": {
       "url": "http://remote_url_repository:9205"
   }
}

```

The elasticsearch.yml was set as follows:

`repositories.url.allowed_urls: "http://remote_url_repository:9205"`

The GET http://remote\_url\_repository:9205/\_snapshot/elastic\_backup/2017-02-13 returns:

```
{
"snapshots": [
{
    "snapshot": "2017-02-13",
    "uuid": "F_Q8708SSqC9yHJZ_xNefw",
    "version_id": 5010199,
    "version": "5.1.1",
   "indices": [
       "delfos_index_homologacao"
    ],
   "state": "SUCCESS",
   "start_time": "2017-02-13T14:14:31.438Z",
   "start_time_in_millis": 1486995271438,
   "end_time": "2017-02-13T14:24:59.539Z",
   "end_time_in_millis": 1486995899539,
   "duration_in_millis": 628101,
   "failures": [],
   "shards": {
   "total": 5,
   "failed": 0,
   "successful": 5
  }
 }
]
}

```

When I try to create a local snapshot

PUT localhost:9200/\_snapshot/elastic\_backup/2017-02-13/, I got the exception

```
{
 "error": {
   "root_cause": [
     {
       "type": "repository_exception",
       "reason": "[elastic_backup] cannot create snapshot in a readonly repository"
     }
   ],
   "type": "repository_exception",
   "reason": "[elastic_backup] cannot create snapshot in a readonly repository"
 },
 "status": 500
}

```

What am I suppose to do after the backup creation? If it's a read-only backup, how can I restore a snapshot remotely?

Did I missed something in the back-up creation?

```
{
       "type": "url",
       "settings": {
           "url": "http://remote_url_repository:9205"
       }
    }

```

BTW, which are the "url" type settings in the ES documentation??  
[https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html#\_read\_only\_url\_repository](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/modules-snapshots.html#_read_only_url_repository)

Can anybody give me a hint?

Thanks,

Guilherme

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 16, 2017, 5:38pm UTC](https://discuss.elastic.co/t/restoring-a-snapshot-from-a-remote-repository/75378/2 "2017-02-16T17:38:09Z")

</div>

URL repositories are only readonly. You can't write to them.

It's often used if you backup your data using shared FS or S3 or gcs or azure, then expose the backup behind a webserver so people can download your data but can't write to them.

Makes sense?

---

<div class="post-metadata">

**Author:** ![guilherme\_maranhao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guilherme_maranhao/32/101483_2.png) [@guilherme\_maranhao](https://discuss.elastic.co/u/guilherme_maranhao)\
**Post date:** [February 16, 2017, 6:58pm UTC](https://discuss.elastic.co/t/restoring-a-snapshot-from-a-remote-repository/75378/3 "2017-02-16T18:58:55Z")

</div>

Sure, @dadoonet! Thank you!

---

<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:** [March 16, 2017, 6:59pm UTC](https://discuss.elastic.co/t/restoring-a-snapshot-from-a-remote-repository/75378/4 "2017-03-16T18:59:30Z")

</div>

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