# Tutorial for Backup

**URL:** <https://discuss.elastic.co/t/tutorial-for-backup/43624>\
**Category:** Elasticsearch\
**Created:** [March 7, 2016, 7:25am UTC](https://discuss.elastic.co/t/tutorial-for-backup/43624 "2016-03-07T07:25:29Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![gringo](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@gringo](https://discuss.elastic.co/u/gringo)\
**Post date:** [March 7, 2016, 7:25am UTC](https://discuss.elastic.co/t/tutorial-for-backup/43624/1 "2016-03-07T07:25:29Z")

</div>

Is there any working documentation for back up?

This link is what I can find  
[https://www.elastic.co/guide/en/elasticsearch/guide/current/backing-up-your-cluster.html](https://www.elastic.co/guide/en/elasticsearch/guide/current/backing-up-your-cluster.html)  
It does not work at all. Totally useless

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [March 7, 2016, 7:33am UTC](https://discuss.elastic.co/t/tutorial-for-backup/43624/2 "2016-03-07T07:33:38Z")

</div>

There's additional snapshot/restore documentation at [elastic.co](http://elastic.co). Anyway, you'll get better help if you explain what you're having problems with.

---

<div class="post-metadata">

**Author:** ![gringo](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@gringo](https://discuss.elastic.co/u/gringo)\
**Post date:** [March 7, 2016, 7:49am UTC](https://discuss.elastic.co/t/tutorial-for-backup/43624/3 "2016-03-07T07:49:31Z")

</div>

Did this in kibana sense

PUT /\_snapshot/my\_backup  
{  
"type": "fs",  
"settings": {  
location": "/home/elastic/logstash\_scripts/123456"  
}  
}

Result

{  
"error": {  
"root\_cause": [  
{  
"type": "illegal\_argument\_exception",  
"reason": "failed to parse repository source [{\n "type": "fs"\n "settings": {\n location": "/home/elastic/logstash\_scripts/123456"\n }\n}\n]"  
}  
],  
"type": "illegal\_argument\_exception",  
"reason": "failed to parse repository source [{\n "type": "fs"\n "settings": {\n location": "/home/elastic/logstash\_scripts/123456"\n }\n}\n]",  
"caused\_by": {  
"type": "json\_parse\_exception",  
"reason": "Unexpected character ('"' (code 34)): was expecting comma to separate OBJECT entries\n at [Source: {\n "type": "fs"\n "settings": {\n location": "/home/elastic/logstash\_scripts/123456"\n }\n}\n; line: 3, column: 4]"  
}  
},  
"status": 400  
}

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [March 7, 2016, 8:14am UTC](https://discuss.elastic.co/t/tutorial-for-backup/43624/4 "2016-03-07T08:14:47Z")

</div>

There's a double quote missing from this line:

```
location": "/home/elastic/logstash_scripts/123456"
```

---

<div class="post-metadata">

**Author:** ![gringo](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@gringo](https://discuss.elastic.co/u/gringo)\
**Post date:** [March 7, 2016, 8:42am UTC](https://discuss.elastic.co/t/tutorial-for-backup/43624/5 "2016-03-07T08:42:51Z")

</div>

PUT /\_snapshot/my\_backup  
{

"settings": {  
"type": "fs",  
"location": "/home/elastic/logstash\_scripts/123456"  
}  
}

{  
"error": {  
"root\_cause": [  
{  
"type": "action\_request\_validation\_exception",  
"reason": "Validation Failed: 1: type is missing;"  
}  
],  
"type": "action\_request\_validation\_exception",  
"reason": "Validation Failed: 1: type is missing;"  
},  
"status": 400  
}

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [March 7, 2016, 9:16am UTC](https://discuss.elastic.co/t/tutorial-for-backup/43624/6 "2016-03-07T09:16:12Z")

</div>

Please look more carefully at the examples. The "type" key should be at the top level, not inside "settings".

---

<div class="post-metadata">

**Author:** ![gringo](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@gringo](https://discuss.elastic.co/u/gringo)\
**Post date:** [March 7, 2016, 9:28am UTC](https://discuss.elastic.co/t/tutorial-for-backup/43624/7 "2016-03-07T09:28:57Z")

</div>

PUT /\_snapshot/my\_backup  
{  
"type": "fs",  
"settings": {

```
    "location": "/home/elastic/logstash_scripts"

```

}  
}

## Result

{  
"error": {  
"root\_cause": [  
{  
"type": "repository\_exception",  
"reason": "[my\_backup] location [/home/elastic/logstash\_scripts] doesn't match any of the locations specified by path.repo"  
}  
],  
"type": "repository\_exception",  
"reason": "[my\_backup] failed to create repository",  
"caused\_by": {  
"type": "creation\_exception",  
"reason": "Guice creation errors:\n\n1) Error injecting constructor, RepositoryException[[my\_backup] location [/home/elastic/logstash\_scripts] doesn't match any of the locations specified by path.repo]\n at org.elasticsearch.repositories.fs.FsRepository.(Unknown Source)\n while locating org.elasticsearch.repositories.fs.FsRepository\n while locating org.elasticsearch.repositories.Repository\n\n1 error",  
"caused\_by": {  
"type": "repository\_exception",  
"reason": "[my\_backup] location [/home/elastic/logstash\_scripts] doesn't match any of the locations specified by path.repo"  
}  
}  
},  
"status": 500  
}

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [March 7, 2016, 9:35am UTC](https://discuss.elastic.co/t/tutorial-for-backup/43624/8 "2016-03-07T09:35:16Z")

</div>

Have you read what the documentation says about the path.repo setting?

---

<div class="post-metadata">

**Author:** ![gringo](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@gringo](https://discuss.elastic.co/u/gringo)\
**Post date:** [March 7, 2016, 9:59am UTC](https://discuss.elastic.co/t/tutorial-for-backup/43624/9 "2016-03-07T09:59:41Z")

</div>

Almost impossible to understand.

what does the following path mean?  
path.repo: ["/mount/backups", "/mount/longterm\_backups"]

I must have two path for backup? Which server will the backup reside in? I have nodes in different servers

I have done this settings but the above error message still appears

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [March 7, 2016, 12:24pm UTC](https://discuss.elastic.co/t/tutorial-for-backup/43624/10 "2016-03-07T12:24:34Z")

</div>

No, it's not impossible to understand. Your attitude is not helpful.

path.repo lists the paths where backup repositories are allowed.

> I must have two path for backup?

No, that's just an example.

> Which server will the backup reside in? I have nodes in different servers

The backup files will be stored in the path you specify. That path must be accessible from all nodes in the cluster. Which server that physically stores the files doesn't matter, but it's typically on an NFS server.

---

<div class="post-metadata">

**Author:** ![gringo](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@gringo](https://discuss.elastic.co/u/gringo)\
**Post date:** [March 9, 2016, 1:17am UTC](https://discuss.elastic.co/t/tutorial-for-backup/43624/11 "2016-03-09T01:17:25Z")

</div>

Can I set the path to e.g. c:\my\_folder\backup? If I were to do this can I put this in the settings of the elasticsearch.yml in one of the Nodes?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [March 9, 2016, 6:31am UTC](https://discuss.elastic.co/t/tutorial-for-backup/43624/12 "2016-03-09T06:31:26Z")

</div>

The _same_ directory needs to be accessible to all nodes which most likely isn't the case with c:\my\_folder\backup. Even if you create such a directory on all nodes they will be different directories that just happens to share the same name for each ES process.

---

<div class="post-metadata">

**Author:** ![gringo](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@gringo](https://discuss.elastic.co/u/gringo)\
**Post date:** [April 5, 2016, 8:33am UTC](https://discuss.elastic.co/t/tutorial-for-backup/43624/13 "2016-04-05T08:33:11Z")

</div>

I have done the following

PUT /\_snapshot/my\_backup  
{  
"type": "fs",  
"settings": {  
"compress": "true",  
"location": "\\191.0.0.16\Logs\ES\_TEST"  
}

What should I do next. How to get the backup to start? There is not information on how the backup will work.  
}

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [April 5, 2016, 8:37am UTC](https://discuss.elastic.co/t/tutorial-for-backup/43624/14 "2016-04-05T08:37:18Z")

</div>

Have you read the [Snapshot section](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html#_snapshot) of the Snapshot And Restore chapter of the documentation?

---

<div class="post-metadata">

**Author:** ![gringo](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@gringo](https://discuss.elastic.co/u/gringo)\
**Post date:** [April 5, 2016, 8:50am UTC](https://discuss.elastic.co/t/tutorial-for-backup/43624/15 "2016-04-05T08:50:14Z")

</div>

Read it. It's very difficult to understand and very confusing.

---

<div class="post-metadata">

**Author:** ![gringo](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@gringo](https://discuss.elastic.co/u/gringo)\
**Post date:** [April 5, 2016, 9:05am UTC](https://discuss.elastic.co/t/tutorial-for-backup/43624/16 "2016-04-05T09:05:26Z")

</div>

Based on the information in the Snapshot section I can only conclude that there is no working backup feature in elasticsearch

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [April 5, 2016, 9:24am UTC](https://discuss.elastic.co/t/tutorial-for-backup/43624/17 "2016-04-05T09:24:28Z")

</div>

> Read it. It's very difficult to understand and very confusing.

Then I suggest you ask questions about the parts you find confusing.

> Based on the information in the Snapshot section I can only conclude that there is no working backup feature in elasticsearch

I don't agree, but without more information from you I can't comment further.

---

<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:** [July 5, 2017, 11:02pm UTC](https://discuss.elastic.co/t/tutorial-for-backup/43624/18 "2017-07-05T23:02:19Z")

</div>


