# Backing Up ES

**URL:** https://discuss.elastic.co/t/backing-up-es/6971
**Category:** Elasticsearch
**Created:** [March 13, 2012, 3:24am UTC](https://discuss.elastic.co/t/backing-up-es/6971 "2012-03-13T03:24:02Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Eugene\_Strokin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eugene_strokin/32/1238_2.png) [@Eugene\_Strokin](https://discuss.elastic.co/u/Eugene_Strokin)
#### Post date: [March 13, 2012, 3:24am UTC](https://discuss.elastic.co/t/backing-up-es/6971/1 "2012-03-13T03:24:02Z")

</div>

Hello, I'm planning to use very nice script by Karussell

> <https://gist.github.com/karussell/1074906>
>
> There are more than three files. show original

  
for backing up my ES.  
But I have a cluster of currently 2 machines running the ES.  
I want to make sure, that this is enough to copy the files just from one  
machine, because after flush they are the same on both server boxes.  
And to restore, I just need to restore files on one machine, run ES, and on  
another I'd just run empty ES server with my custom mappings, and the  
second machine would pick the data up from the first.  
Am I correct, or my assumption is mistaken?

Thank you,  
Eugene S.

---

<div class="post-metadata">

### Author: ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)
#### Post date: [March 14, 2012, 12:05pm UTC](https://discuss.elastic.co/t/backing-up-es/6971/2 "2012-03-14T12:05:51Z")

</div>

Yes, assuming you have 1 replica, and 2 machines, you only need to copy one machine over. And the restore process you mentioned is good.

On Tuesday, March 13, 2012 at 5:24 AM, Eugene Strokin wrote:

> Hello, I'm planning to use very nice script by Karussell  
> [Backup ElasticSearch with rsync · GitHub](https://gist.github.com/1074906)  
> for backing up my ES.
> 
> But I have a cluster of currently 2 machines running the ES.  
> I want to make sure, that this is enough to copy the files just from one machine, because after flush they are the same on both server boxes.  
> And to restore, I just need to restore files on one machine, run ES, and on another I'd just run empty ES server with my custom mappings, and the second machine would pick the data up from the first.  
> Am I correct, or my assumption is mistaken?
> 
> Thank you,  
> Eugene S.

---

<div class="post-metadata">

### Author: ![Barsk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/barsk/32/13734_2.png) [@Barsk](https://discuss.elastic.co/u/Barsk)
#### Post date: [March 19, 2012, 9:13am UTC](https://discuss.elastic.co/t/backing-up-es/6971/3 "2012-03-19T09:13:31Z")

</div>

Regarding backup. Since I am using ES sort of as a noSQL database it  
will not be possible to reindex from scratch after updates has been done  
to the documents.  
Is it guaranteed that it will always be possible to import an index to a  
newer version of ES without need of reindexing it?

Second question. How do you backup shards that are not on the local  
node? I am not there yet, but I might be in future...

/Kristian

Shay Banon skrev 2012-03-14 13:05:

> Yes, assuming you have 1 replica, and 2 machines, you only need to  
> copy one machine over. And the restore process you mentioned is good.
> 
> On Tuesday, March 13, 2012 at 5:24 AM, Eugene Strokin wrote:
> 
> > Hello, I'm planning to use very nice script by Karussell  
> > [Backup ElasticSearch with rsync · GitHub](https://gist.github.com/1074906)  
> > for backing up my ES.  
> > But I have a cluster of currently 2 machines running the ES.  
> > I want to make sure, that this is enough to copy the files just from  
> > one machine, because after flush they are the same on both server boxes.  
> > And to restore, I just need to restore files on one machine, run ES,  
> > and on another I'd just run empty ES server with my custom mappings,  
> > and the second machine would pick the data up from the first.  
> > Am I correct, or my assumption is mistaken?
> > 
> > Thank you,  
> > Eugene S.

--  
Med vÃ¤nlig hÃ¤lsning  
Kristian JÃ¶rg

Devo IT AB  
Tel: 054 - 22 14 58, 0709 - 15 83 42  
E-post: kristian.jorg@devo.se  
Webb: [http://www.devo.se](http://www.devo.se)

---

<div class="post-metadata">

### Author: ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)
#### Post date: [March 20, 2012, 10:41am UTC](https://discuss.elastic.co/t/backing-up-es/6971/4 "2012-03-20T10:41:31Z")

</div>

Yes, you will always be able to upgrade to a newer version without needing  
to reindex. A multi node cluster backup simplest option is to backup each  
node data location.

On Mon, Mar 19, 2012 at 11:13 AM, Kristian Jörg [krjg@devo.se](mailto:krjg@devo.se) wrote:

> Regarding backup. Since I am using ES sort of as a noSQL database it will  
> not be possible to reindex from scratch after updates has been done to the  
> documents.  
> Is it guaranteed that it will always be possible to import an index to a  
> newer version of ES without need of reindexing it?
> 
> Second question. How do you backup shards that are not on the local node?  
> I am not there yet, but I might be in future...
> 
> /Kristian
> 
> Shay Banon skrev 2012-03-14 13:05:
> 
> Yes, assuming you have 1 replica, and 2 machines, you only need to copy
> 
> > one machine over. And the restore process you mentioned is good.
> > 
> > On Tuesday, March 13, 2012 at 5:24 AM, Eugene Strokin wrote:
> > 
> > Hello, I'm planning to use very nice script by Karussell
> > 
> > > [https://gist.github.com/\*\*1074906](https://gist.github.com/**1074906) [https://gist.github.com/1074906](https://gist.github.com/1074906)  
> > > for backing up my ES.  
> > > But I have a cluster of currently 2 machines running the ES.  
> > > I want to make sure, that this is enough to copy the files just from one  
> > > machine, because after flush they are the same on both server boxes.  
> > > And to restore, I just need to restore files on one machine, run ES, and  
> > > on another I'd just run empty ES server with my custom mappings, and the  
> > > second machine would pick the data up from the first.  
> > > Am I correct, or my assumption is mistaken?
> > > 
> > > Thank you,  
> > > Eugene S.
> 
> --  
> Med vänlig hälsning  
> Kristian Jörg
> 
> Devo IT AB  
> Tel: 054 - 22 14 58, 0709 - 15 83 42  
> E-post: kristian.jorg@devo.se  
> Webb: [http://www.devo.se](http://www.devo.se)

---

<div class="post-metadata">

### Author: ![Barsk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/barsk/32/13734_2.png) [@Barsk](https://discuss.elastic.co/u/Barsk)
#### Post date: [March 20, 2012, 1:52pm UTC](https://discuss.elastic.co/t/backing-up-es/6971/5 "2012-03-20T13:52:16Z")

</div>

```
Ok, but do one still need to temporarily disable flush as the script
does, on each node, prior to backup? Or is the setting "global" for
the cluster?

```

```
-- 
Med vänlig hälsning
Kristian Jörg

Devo IT AB
Tel: 054 - 22 14 58, 0709 - 15 83 42
E-post:[kristian.jorg@devo.se](mailto:kristian.jorg@devo.se)Webb:[http://www.devo.se](http://www.devo.se)
```

```
Shay Banon skrev 2012-03-20 11:41:
<blockquote cite="mid:CALzs+uxjRFMN4LwPWkTxDhyF1KtGVnNuWQdP_EGmOTfurs3aSw@mail.gmail.com" type="cite">Yes, you will always be able to upgrade to a newer
    version without needing to reindex. A multi node cluster backup
    simplest option is to backup each node data location.

```

> On Mon, Mar 19, 2012 at 11:13 AM,  
> Kristian Jörg \<[krjg@devo.se](mailto:krjg@devo.se)\>  
> wrote:
> 
> > Regarding backup. Since I am using ES sort of as a noSQL database it will not be possible to reindex from scratch after updates has been done to the documents.
> > 
> > ```
> > Is it guaranteed that it will always be possible to import
> > an index to a newer version of ES without need of reindexing
> > it?
> > 
> > Second question. How do you backup shards that are not on
> > the local node? I am not there yet, but I might be in
> > future...
> > 
> > /Kristian
> > 
> > Shay Banon skrev 2012-03-14 13:05:
> > 
> > ```
> > 
> > > Yes, assuming you have 1 replica, and 2 machines, you only need to copy one machine over. And the restore process you mentioned is good.
> > > 
> > > ```
> > > On Tuesday, March 13, 2012 at 5:24 AM, Eugene Strokin
> > > wrote:
> > > 
> > > ```
> > > 
> > > > Hello, I'm planning to use very nice script by Karussell
> > > > 
> > > > [https://gist.github.com/1074906](https://gist.github.com/1074906)
> > > > 
> > > > ```
> > > > for backing up my ES.
> > > > 
> > > > But I have a cluster of currently 2 machines running
> > > > the ES.
> > > > 
> > > > I want to make sure, that this is enough to copy the
> > > > files just from one machine, because after flush
> > > > they are the same on both server boxes.
> > > > 
> > > > And to restore, I just need to restore files on one
> > > > machine, run ES, and on another I'd just run empty
> > > > ES server with my custom mappings, and the second
> > > > machine would pick the data up from the first.
> > > > 
> > > > Am I correct, or my assumption is mistaken?
> > > > 
> > > > Thank you,
> > > > 
> > > > Eugene S.
> > > > 
> > > > ```
> > 
> > ```
> > -- 
> > 
> > Med vänlig hälsning
> > 
> > Kristian Jörg
> > 
> > Devo IT AB
> > 
> > Tel: 054 - 22 14 58, 0709 - 15 83 42
> > 
> > E-post: <a moz-do-not-send="true" href="mailto:kristian.jorg@devo.se" target="_blank">kristian.jorg@devo.se</a>
> > 
> > Webb: <a moz-do-not-send="true" href="http://www.devo.se" target="_blank">http://www.devo.se</a>
> > 
> > ```

```

```

---

<div class="post-metadata">

### Author: ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)
#### Post date: [March 20, 2012, 8:17pm UTC](https://discuss.elastic.co/t/backing-up-es/6971/6 "2012-03-20T20:17:55Z")

</div>

In the script, the update setting is global and applied to all indices. So  
you need to execute it once and it will apply to the whole cluster.

On Tue, Mar 20, 2012 at 3:52 PM, Kristian Jörg [krjg@devo.se](mailto:krjg@devo.se) wrote:

> Ok, but do one still need to temporarily disable flush as the script  
> does, on each node, prior to backup? Or is the setting "global" for the  
> cluster?
> 
> --  
> Med vänlig hälsning  
> Kristian Jörg
> 
> Devo IT AB  
> Tel: 054 - 22 14 58, 0709 - 15 83 42  
> E-post: kristian.jorg@devo.se  
> Webb: [http://www.devo.se](http://www.devo.se)
> 
> Shay Banon skrev 2012-03-20 11:41:
> 
> Yes, you will always be able to upgrade to a newer version without needing  
> to reindex. A multi node cluster backup simplest option is to backup each  
> node data location.
> 
> On Mon, Mar 19, 2012 at 11:13 AM, Kristian Jörg [krjg@devo.se](mailto:krjg@devo.se) wrote:
> 
> > Regarding backup. Since I am using ES sort of as a noSQL database it will  
> > not be possible to reindex from scratch after updates has been done to the  
> > documents.  
> > Is it guaranteed that it will always be possible to import an index to a  
> > newer version of ES without need of reindexing it?
> > 
> > Second question. How do you backup shards that are not on the local node?  
> > I am not there yet, but I might be in future...
> > 
> > /Kristian
> > 
> > Shay Banon skrev 2012-03-14 13:05:
> > 
> > Yes, assuming you have 1 replica, and 2 machines, you only need to copy
> > 
> > > one machine over. And the restore process you mentioned is good.
> > > 
> > > On Tuesday, March 13, 2012 at 5:24 AM, Eugene Strokin wrote:
> > > 
> > > Hello, I'm planning to use very nice script by Karussell
> > > 
> > > > [Backup ElasticSearch with rsync · GitHub](https://gist.github.com/1074906)  
> > > > for backing up my ES.  
> > > > But I have a cluster of currently 2 machines running the ES.  
> > > > I want to make sure, that this is enough to copy the files just from  
> > > > one machine, because after flush they are the same on both server boxes.  
> > > > And to restore, I just need to restore files on one machine, run ES,  
> > > > and on another I'd just run empty ES server with my custom mappings, and  
> > > > the second machine would pick the data up from the first.  
> > > > Am I correct, or my assumption is mistaken?
> > > > 
> > > > Thank you,  
> > > > Eugene S.
> > 
> > --  
> > Med vänlig hälsning  
> > Kristian Jörg
> > 
> > Devo IT AB  
> > Tel: 054 - 22 14 58, 0709 - 15 83 42  
> > E-post: kristian.jorg@devo.se  
> > Webb: [http://www.devo.se](http://www.devo.se)

---

<div class="post-metadata">

### Author: ![Barsk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/barsk/32/13734_2.png) [@Barsk](https://discuss.elastic.co/u/Barsk)
#### Post date: [March 21, 2012, 7:10am UTC](https://discuss.elastic.co/t/backing-up-es/6971/7 "2012-03-21T07:10:41Z")

</div>

```
Yes, that is what I thought. 

Thanx for all help!

/Kristian

Shay Banon skrev 2012-03-20 21:17:
<blockquote cite="mid:CALzs+uwB6U+fGP=hzd8B+KZnPX9yUwmHNPU9tTz3RLx4HDHcOg@mail.gmail.com" type="cite">In the script, the update setting is global and
    applied to all indices. So you need to execute it once and it
    will apply to the whole cluster.

```

On Tue, Mar 20, 2012 at 3:52 PM,  
Kristian Jörg \<[krjg@devo.se](mailto:krjg@devo.se)\>  
wrote:

> Ok, but do one still need to temporarily disable flush as the script does, on each node, prior to backup? Or is the setting "global" for the cluster?
> ```
> -- 
> Med vänlig hälsning
> Kristian Jörg
> 
> Devo IT AB
> Tel: 054 - 22 14 58, 0709 - 15 83 42
> E-post:[kristian.jorg@devo.se](mailto:kristian.jorg@devo.se)Webb:[http://www.devo.se](http://www.devo.se)
> ```
> 
> ```
> Shay Banon skrev 2012-03-20 11:41:
> <blockquote type="cite">Yes, you will always be able to
> upgrade to a newer version without needing to
> reindex. A multi node cluster backup simplest
> option is to backup each node data location.
> 
> ```

> On Mon, Mar 19, 2012 at  
> 11:13 AM, Kristian Jörg \<[krjg@devo.se](mailto:krjg@devo.se)\>  
> wrote:
> 
> > Regarding backup. Since I am using ES sort of as a noSQL database it will not be possible to reindex from scratch after updates has been done to the documents.
> > 
> > ```
> > Is it guaranteed that it will always be
> > possible to import an index to a newer version
> > of ES without need of reindexing it?
> > 
> > Second question. How do you backup shards that
> > are not on the local node? I am not there yet,
> > but I might be in future...
> > 
> > /Kristian
> > 
> > Shay Banon skrev 2012-03-14 13:05:
> > 
> > ```
> > 
> > > Yes, assuming you have 1 replica, and 2 machines, you only need to copy one machine over. And the restore process you mentioned is good.
> > > 
> > > ```
> > > On Tuesday, March 13, 2012 at 5:24 AM,
> > > Eugene Strokin wrote:
> > > 
> > > ```
> > > 
> > > > Hello, I'm planning to use very nice script by Karussell
> > > > 
> > > > [https://gist.github.com/1074906](https://gist.github.com/1074906)
> > > > 
> > > > ```
> > > > for backing up my ES.
> > > > 
> > > > But I have a cluster of currently 2
> > > > machines running the ES.
> > > > 
> > > > I want to make sure, that this is
> > > > enough to copy the files just from one
> > > > machine, because after flush they are
> > > > the same on both server boxes.
> > > > 
> > > > And to restore, I just need to restore
> > > > files on one machine, run ES, and on
> > > > another I'd just run empty ES server
> > > > with my custom mappings, and the
> > > > second machine would pick the data up
> > > > from the first.
> > > > 
> > > > Am I correct, or my assumption is
> > > > mistaken?
> > > > 
> > > > Thank you,
> > > > 
> > > > Eugene S.
> > > > 
> > > > ```
> > 
> > --
> > 
> > ```
> > Med vänlig hälsning
> > 
> > Kristian Jörg
> > 
> > Devo IT AB
> > 
> > Tel: 054 - 22 14 58, 0709 - 15 83 42
> > 
> > E-post: <a moz-do-not-send="true" href="mailto:kristian.jorg@devo.se" target="_blank">kristian.jorg@devo.se</a>
> > 
> > Webb: <a moz-do-not-send="true" href="http://www.devo.se" target="_blank">http://www.devo.se</a>
> > 
> > ```

```
-- 
Med vänlig hälsning
Kristian Jörg

Devo IT AB
Tel: 054 - 22 14 58, 0709 - 15 83 42
E-post:[kristian.jorg@devo.se](mailto:kristian.jorg@devo.se)Webb:[http://www.devo.se](http://www.devo.se)
```

---

<div class="post-metadata">

### Author: ![Frederic](https://avatars.discourse-cdn.com/v4/letter/f/4491bb/32.png) [@Frederic](https://discuss.elastic.co/u/Frederic)
#### Post date: [March 21, 2012, 3:21pm UTC](https://discuss.elastic.co/t/backing-up-es/6971/8 "2012-03-21T15:21:29Z")

</div>

Hi Kimchy,

Based on what you said, I understand that f I needed to restore backed up  
data, I would only need to replace current data directory with its copy,  
shutting down the cluster first I guess.

So, lets suppose I want to recover the data but one of the servers fails  
and it can't run again, but I can recover the data (stored in a remote  
iSCSI in this case). I will only need to replace that server with a new  
one, and copy/mount the data to the new server, to always have 1 node per  
data copy right?

Thanks,

On Tuesday, 20 March 2012 07:41:31 UTC-3, kimchy wrote:

> Yes, you will always be able to upgrade to a newer version without needing  
> to reindex. A multi node cluster backup simplest option is to backup each  
> node data location.

---

<div class="post-metadata">

### Author: ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)
#### Post date: [March 25, 2012, 10:18am UTC](https://discuss.elastic.co/t/backing-up-es/6971/9 "2012-03-25T10:18:29Z")

</div>

Yes, you will just need to have the nodes pointing to the backed up data  
location of each node. Then fire back the cluster.

On Wed, Mar 21, 2012 at 5:21 PM, Frederic [focampo.br@gmail.com](mailto:focampo.br@gmail.com) wrote:

> Hi Kimchy,
> 
> Based on what you said, I understand that f I needed to restore backed up  
> data, I would only need to replace current data directory with its copy,  
> shutting down the cluster first I guess.
> 
> So, lets suppose I want to recover the data but one of the servers fails  
> and it can't run again, but I can recover the data (stored in a remote  
> iSCSI in this case). I will only need to replace that server with a new  
> one, and copy/mount the data to the new server, to always have 1 node per  
> data copy right?
> 
> Thanks,
> 
> On Tuesday, 20 March 2012 07:41:31 UTC-3, kimchy wrote:
> 
> > Yes, you will always be able to upgrade to a newer version without  
> > needing to reindex. A multi node cluster backup simplest option is to  
> > backup each node data location.

---

<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 6, 2017, 3:34am UTC](https://discuss.elastic.co/t/backing-up-es/6971/10 "2017-07-06T03:34:59Z")

</div>


