# Backing up and Restoring a specific index

**URL:** <https://discuss.elastic.co/t/backing-up-and-restoring-a-specific-index/3204>\
**Category:** Elasticsearch\
**Created:** [August 10, 2010, 3:05pm UTC](https://discuss.elastic.co/t/backing-up-and-restoring-a-specific-index/3204 "2010-08-10T15:05:12Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![talsalmona](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/talsalmona/32/3316_2.png) [@talsalmona](https://discuss.elastic.co/u/talsalmona)\
**Post date:** [August 10, 2010, 3:05pm UTC](https://discuss.elastic.co/t/backing-up-and-restoring-a-specific-index/3204/1 "2010-08-10T15:05:12Z")

</div>

Hi,

I have a multi-tenant system where each tenant has their own index. It  
is sometimes required to restore a tenant to its previous state.

Is it possible to backup and restore each index (tenant) separately?

More specifically:

1. Can I backup each index data folder in the gateway separately?
2. Can I restore each index data folder to the gateway separately?
3. What about the metadata? It holds data for all the indexes so when  
I restore a index folder it may be our of sync with the metadata.
4. How do I empty the transaction log of data related to an index  
before I restore it? Do I need to flush? I wouldn't want to have data  
in the index that is both from the restored index and from the  
transaction log that was flushed after the restore.
5. Can I somehow shutdown an index, and tell it to reload from the  
gateway (and ignore its work folder)?

Thanks,  
Tal

---

<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:** [August 10, 2010, 6:02pm UTC](https://discuss.elastic.co/t/backing-up-and-restoring-a-specific-index/3204/2 "2010-08-10T18:02:14Z")

</div>

No, there isn't support for per index management to this degree. Can be  
implemented, with various difficulties depending on what exactly is needed.  
For example, just snapshotting an index to a gateway, and then restoring  
from it is simple. The metadata is the more complex part since it is not  
stored on a per index leve, but globally.

-shay.banon

On Tue, Aug 10, 2010 at 6:05 PM, Tal [talsalmona@gmail.com](mailto:talsalmona@gmail.com) wrote:

> Hi,
> 
> I have a multi-tenant system where each tenant has their own index. It  
> is sometimes required to restore a tenant to its previous state.
> 
> Is it possible to backup and restore each index (tenant) separately?
> 
> More specifically:
> 
> 1. Can I backup each index data folder in the gateway separately?
> 2. Can I restore each index data folder to the gateway separately?
> 3. What about the metadata? It holds data for all the indexes so when  
> I restore a index folder it may be our of sync with the metadata.
> 4. How do I empty the transaction log of data related to an index  
> before I restore it? Do I need to flush? I wouldn't want to have data  
> in the index that is both from the restored index and from the  
> transaction log that was flushed after the restore.
> 5. Can I somehow shutdown an index, and tell it to reload from the  
> gateway (and ignore its work folder)?
> 
> Thanks,  
> Tal

---

<div class="post-metadata">

**Author:** ![talsalmona](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/talsalmona/32/3316_2.png) [@talsalmona](https://discuss.elastic.co/u/talsalmona)\
**Post date:** [August 11, 2010, 9:28am UTC](https://discuss.elastic.co/t/backing-up-and-restoring-a-specific-index/3204/3 "2010-08-11T09:28:54Z")

</div>

Is this something you are planning for a future release?  
I think that it is an important use case for multi-tenant  
applications. In many cases you even let the customer (tenant owner or  
admin) initiate the restore on their own.

Tal.

On Aug 10, 9:02 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> No, there isn't support for per index management to this degree. Can be  
> implemented, with various difficulties depending on what exactly is needed.  
> For example, just snapshotting an index to a gateway, and then restoring  
> from it is simple. The metadata is the more complex part since it is not  
> stored on a per index leve, but globally.
> 
> -shay.banon
> 
> On Tue, Aug 10, 2010 at 6:05 PM, Tal [talsalm...@gmail.com](mailto:talsalm...@gmail.com) wrote:
> 
> > Hi,
> 
> > I have a multi-tenant system where each tenant has their own index. It  
> > is sometimes required to restore a tenant to its previous state.
> 
> > Is it possible to backup and restore each index (tenant) separately?
> 
> > More specifically:
> > 
> > 1. Can I backup each index data folder in the gateway separately?
> > 2. Can I restore each index data folder to the gateway separately?
> > 3. What about the metadata? It holds data for all the indexes so when  
> > I restore a index folder it may be our of sync with the metadata.
> > 4. How do I empty the transaction log of data related to an index  
> > before I restore it? Do I need to flush? I wouldn't want to have data  
> > in the index that is both from the restored index and from the  
> > transaction log that was flushed after the restore.
> > 5. Can I somehow shutdown an index, and tell it to reload from the  
> > gateway (and ignore its work folder)?
> 
> > Thanks,  
> > Tal

---

<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:** [August 11, 2010, 9:56am UTC](https://discuss.elastic.co/t/backing-up-and-restoring-a-specific-index/3204/4 "2010-08-11T09:56:39Z")

</div>

Agreed, it is important. Can you open an issue for this? I am currently  
working on 0.9.1 and want to close what I plan, will try and schedule it for  
the next version.

-shay.banon

On Wed, Aug 11, 2010 at 12:28 PM, Tal [talsalmona@gmail.com](mailto:talsalmona@gmail.com) wrote:

> Is this something you are planning for a future release?  
> I think that it is an important use case for multi-tenant  
> applications. In many cases you even let the customer (tenant owner or  
> admin) initiate the restore on their own.
> 
> Tal.
> 
> On Aug 10, 9:02 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> 
> > No, there isn't support for per index management to this degree. Can be  
> > implemented, with various difficulties depending on what exactly is  
> > needed.  
> > For example, just snapshotting an index to a gateway, and then restoring  
> > from it is simple. The metadata is the more complex part since it is not  
> > stored on a per index leve, but globally.
> > 
> > -shay.banon
> > 
> > On Tue, Aug 10, 2010 at 6:05 PM, Tal [talsalm...@gmail.com](mailto:talsalm...@gmail.com) wrote:
> > 
> > > Hi,
> > 
> > > I have a multi-tenant system where each tenant has their own index. It  
> > > is sometimes required to restore a tenant to its previous state.
> > 
> > > Is it possible to backup and restore each index (tenant) separately?
> > 
> > > More specifically:
> > > 
> > > 1. Can I backup each index data folder in the gateway separately?
> > > 2. Can I restore each index data folder to the gateway separately?
> > > 3. What about the metadata? It holds data for all the indexes so when  
> > > I restore a index folder it may be our of sync with the metadata.
> > > 4. How do I empty the transaction log of data related to an index  
> > > before I restore it? Do I need to flush? I wouldn't want to have data  
> > > in the index that is both from the restored index and from the  
> > > transaction log that was flushed after the restore.
> > > 5. Can I somehow shutdown an index, and tell it to reload from the  
> > > gateway (and ignore its work folder)?
> > 
> > > Thanks,  
> > > Tal

---

<div class="post-metadata">

**Author:** ![ppearcy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppearcy/32/980_2.png) [@ppearcy](https://discuss.elastic.co/u/ppearcy)\
**Post date:** [August 11, 2010, 4:06pm UTC](https://discuss.elastic.co/t/backing-up-and-restoring-a-specific-index/3204/5 "2010-08-11T16:06:30Z")

</div>

Yeah, I would like this feature, as well, but figured it wouldn't be  
too hard to add myself outside of ES for my use case.

Thanks!

On Aug 11, 3:56 am, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> Agreed, it is important. Can you open an issue for this? I am currently  
> working on 0.9.1 and want to close what I plan, will try and schedule it for  
> the next version.
> 
> -shay.banon
> 
> On Wed, Aug 11, 2010 at 12:28 PM, Tal [talsalm...@gmail.com](mailto:talsalm...@gmail.com) wrote:
> 
> > Is this something you are planning for a future release?  
> > I think that it is an important use case for multi-tenant  
> > applications. In many cases you even let the customer (tenant owner or  
> > admin) initiate the restore on their own.
> 
> > Tal.
> 
> > On Aug 10, 9:02 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> > 
> > > No, there isn't support for per index management to this degree. Can be  
> > > implemented, with various difficulties depending on what exactly is  
> > > needed.  
> > > For example, just snapshotting an index to a gateway, and then restoring  
> > > from it is simple. The metadata is the more complex part since it is not  
> > > stored on a per index leve, but globally.
> 
> > > -shay.banon
> 
> > > On Tue, Aug 10, 2010 at 6:05 PM, Tal [talsalm...@gmail.com](mailto:talsalm...@gmail.com) wrote:
> > > 
> > > > Hi,
> 
> > > > I have a multi-tenant system where each tenant has their own index. It  
> > > > is sometimes required to restore a tenant to its previous state.
> 
> > > > Is it possible to backup and restore each index (tenant) separately?
> 
> > > > More specifically:
> > > > 
> > > > 1. Can I backup each index data folder in the gateway separately?
> > > > 2. Can I restore each index data folder to the gateway separately?
> > > > 3. What about the metadata? It holds data for all the indexes so when  
> > > > I restore a index folder it may be our of sync with the metadata.
> > > > 4. How do I empty the transaction log of data related to an index  
> > > > before I restore it? Do I need to flush? I wouldn't want to have data  
> > > > in the index that is both from the restored index and from the  
> > > > transaction log that was flushed after the restore.
> > > > 5. Can I somehow shutdown an index, and tell it to reload from the  
> > > > gateway (and ignore its work folder)?
> 
> > > > Thanks,  
> > > > Tal

---

<div class="post-metadata">

**Author:** ![talsalmona](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/talsalmona/32/3316_2.png) [@talsalmona](https://discuss.elastic.co/u/talsalmona)\
**Post date:** [August 11, 2010, 5:00pm UTC](https://discuss.elastic.co/t/backing-up-and-restoring-a-specific-index/3204/6 "2010-08-11T17:00:27Z")

</div>

Added issue: [Backing up and Restoring a Specific Index · Issue #313 · elastic/elasticsearch · GitHub](http://github.com/elasticsearch/elasticsearch/issues/issue/313)

On Aug 11, 7:06 pm, Paul [ppea...@gmail.com](mailto:ppea...@gmail.com) wrote:

> Yeah, I would like this feature, as well, but figured it wouldn't be  
> too hard to add myself outside of ES for my use case.
> 
> Thanks!
> 
> On Aug 11, 3:56 am, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> 
> > Agreed, it is important. Can you open an issue for this? I am currently  
> > working on 0.9.1 and want to close what I plan, will try and schedule it for  
> > the next version.
> 
> > -shay.banon
> 
> > On Wed, Aug 11, 2010 at 12:28 PM, Tal [talsalm...@gmail.com](mailto:talsalm...@gmail.com) wrote:
> > 
> > > Is this something you are planning for a future release?  
> > > I think that it is an important use case for multi-tenant  
> > > applications. In many cases you even let the customer (tenant owner or  
> > > admin) initiate the restore on their own.
> 
> > > Tal.
> 
> > > On Aug 10, 9:02 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> > > 
> > > > No, there isn't support for per index management to this degree. Can be  
> > > > implemented, with various difficulties depending on what exactly is  
> > > > needed.  
> > > > For example, just snapshotting an index to a gateway, and then restoring  
> > > > from it is simple. The metadata is the more complex part since it is not  
> > > > stored on a per index leve, but globally.
> 
> > > > -shay.banon
> 
> > > > On Tue, Aug 10, 2010 at 6:05 PM, Tal [talsalm...@gmail.com](mailto:talsalm...@gmail.com) wrote:
> > > > 
> > > > > Hi,
> 
> > > > > I have a multi-tenant system where each tenant has their own index. It  
> > > > > is sometimes required to restore a tenant to its previous state.
> 
> > > > > Is it possible to backup and restore each index (tenant) separately?
> 
> > > > > More specifically:
> > > > > 
> > > > > 1. Can I backup each index data folder in the gateway separately?
> > > > > 2. Can I restore each index data folder to the gateway separately?
> > > > > 3. What about the metadata? It holds data for all the indexes so when  
> > > > > I restore a index folder it may be our of sync with the metadata.
> > > > > 4. How do I empty the transaction log of data related to an index  
> > > > > before I restore it? Do I need to flush? I wouldn't want to have data  
> > > > > in the index that is both from the restored index and from the  
> > > > > transaction log that was flushed after the restore.
> > > > > 5. Can I somehow shutdown an index, and tell it to reload from the  
> > > > > gateway (and ignore its work folder)?
> 
> > > > > Thanks,  
> > > > > Tal

---

<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, 4:20am UTC](https://discuss.elastic.co/t/backing-up-and-restoring-a-specific-index/3204/7 "2017-07-06T04:20:56Z")

</div>


