# Backup and Restore issue

**URL:** <https://discuss.elastic.co/t/backup-and-restore-issue/40659>\
**Category:** Elasticsearch\
**Created:** [February 1, 2016, 7:00pm UTC](https://discuss.elastic.co/t/backup-and-restore-issue/40659 "2016-02-01T19:00:05Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![sombilat](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@sombilat](https://discuss.elastic.co/u/sombilat)\
**Post date:** [February 1, 2016, 7:00pm UTC](https://discuss.elastic.co/t/backup-and-restore-issue/40659/1 "2016-02-01T19:00:05Z")

</div>

Hello Guys,

I am having an error in creating a backup for my restore point in Elasticsearch. I keep getting this error:

![](https://us1.discourse-cdn.com/elastic/original/2X/2/22d13950a45479fe2b016f146cb230cf84ed5be9.png)

when I run this command:  
curl -XPUT 'localhost:9200/\_snapshot/my\_backup' -d '

```
"my_backup": {
    "type": "FS",
    "settings": {
        "location": "my_backup",
        "compress": true
    }
}

```

}'

Can anyone comment? Did i execute my cURL statement wrong?

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [February 1, 2016, 8:20pm UTC](https://discuss.elastic.co/t/backup-and-restore-issue/40659/2 "2016-02-01T20:20:43Z")

</div>

Like this:

```bash
$ curl -XPUT localhost:9200/_snapshot/my_backup -d '
{
  "type": "fs",
  "settings": {
    "location": "/path/to/repository",
    "compress": true
  }
}'

```

Note that you'll need to have configured `path.repo` as well. You're missing an opening brace (thus the `Failed to derive xcontent` in the error message), but even fixing that you have an extra wrapper `my_backup: { ... }` that you should not have.

---

<div class="post-metadata">

**Author:** ![sombilat](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@sombilat](https://discuss.elastic.co/u/sombilat)\
**Post date:** [February 1, 2016, 8:30pm UTC](https://discuss.elastic.co/t/backup-and-restore-issue/40659/3 "2016-02-01T20:30:45Z")

</div>

Hello jasontedor,

Thank you for the Reply, it is now correct I believe for I faced another error. The **path.repo**. I have set a value of the repository as seen in the screenshot below:

![](https://us1.discourse-cdn.com/elastic/original/2X/d/d97efa44935ebf8b5932e4ec6eba694e162839f2.png)

I created this in the elasticsearch.yml file, did I define it correctly? For I keep getting the "path.repo is empty" error as seen below.

![](https://us1.discourse-cdn.com/elastic/original/2X/b/b81aa7a0677a10e80f217a74b7d09aca69eccbc3.png)

Thanks,

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [February 1, 2016, 9:54pm UTC](https://discuss.elastic.co/t/backup-and-restore-issue/40659/4 "2016-02-01T21:54:13Z")

</div>

You have it commented out with the leading `#` in your screenshot:

![](https://us1.discourse-cdn.com/elastic/original/2X/d/d97efa44935ebf8b5932e4ec6eba694e162839f2.png)

---

<div class="post-metadata">

**Author:** ![sombilat](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@sombilat](https://discuss.elastic.co/u/sombilat)\
**Post date:** [February 1, 2016, 10:06pm UTC](https://discuss.elastic.co/t/backup-and-restore-issue/40659/5 "2016-02-01T22:06:58Z")

</div>

Hello jasontedor,

Thanks for the quick reply, I have removed the commented line and placed it at the edge, as seen below. Although the error still persists, any recommendations?

 ![](https://us1.discourse-cdn.com/elastic/original/2X/8/89cced77191aa889cec56b770fd236de0da7c9f2.png)

I have changed the location to usr/bin for it was one of the declared mounted directories in my system.  
 ![](https://us1.discourse-cdn.com/elastic/original/2X/d/de3a9718eef8fe54226d04be982c19504ac3102b.png)

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [February 1, 2016, 10:36pm UTC](https://discuss.elastic.co/t/backup-and-restore-issue/40659/6 "2016-02-01T22:36:43Z")

</div>

I'm confused, are you on Windows or are you on Linux? Your first attempt seemed to indicate that you're on a Windows system but your second attempt looks to be something different?

You need to set `path.repo` to a path that exists in the filesystem and the Elasticsearch process has privileges to write to. Then you need to use that path when you use the create snapshot API.

---

<div class="post-metadata">

**Author:** ![sombilat](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@sombilat](https://discuss.elastic.co/u/sombilat)\
**Post date:** [February 2, 2016, 12:14pm UTC](https://discuss.elastic.co/t/backup-and-restore-issue/40659/7 "2016-02-02T12:14:32Z")

</div>

Hello jasontedor,

I am using a Windows Platform, the above screenshots shows me using 'Cygwin64'. Cygwin64 or Cygwin emulates a Unix like environment in a Windows Platform. Windows command Line has an issue when I execute curl statements on.

Got it to Work Jason, thanks it was the comment(#) all along. 😅

![](https://us1.discourse-cdn.com/elastic/original/2X/2/2d4a051c232a579f073e05a23fa588e5e201b7e6.png)

![](https://us1.discourse-cdn.com/elastic/original/2X/c/ce06f615f3afd6d014ed7aae738d612014dc415d.png)

Thanks,

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [February 2, 2016, 1:52pm UTC](https://discuss.elastic.co/t/backup-and-restore-issue/40659/8 "2016-02-02T13:52:21Z")

</div>

> [@sombilat](#):
>
> Got it to Work Jason, thanks it was the comment(#) all along. 😅

Awesome, glad that we got it sorted out. 🙂

---

<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:19pm UTC](https://discuss.elastic.co/t/backup-and-restore-issue/40659/9 "2017-07-05T23:19:40Z")

</div>


