# Snapshot - Is it possible to create them based on \*repository\* indices?

**URL:** <https://discuss.elastic.co/t/snapshot-is-it-possible-to-create-them-based-on-repository-indices/43196>\
**Category:** Elasticsearch\
**Created:** [March 2, 2016, 7:08am UTC](https://discuss.elastic.co/t/snapshot-is-it-possible-to-create-them-based-on-repository-indices/43196 "2016-03-02T07:08:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vandamo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vandamo/32/8203_2.png) [@vandamo](https://discuss.elastic.co/u/vandamo)\
**Post date:** [March 2, 2016, 7:08am UTC](https://discuss.elastic.co/t/snapshot-is-it-possible-to-create-them-based-on-repository-indices/43196/1 "2016-03-02T07:08:52Z")

</div>

Hi,  
To provide a bit of context, I recently started a new mission at a client (I'm an employee consultant), where they are using the Elastic Stack.

We are using curator to create snapshots, till now only time-based.  
The snapshots contain 4 different indices "type": alpha, beta, gamma, delta, each created on a daily basis.

The repository used (shared file system) is reaching its limit, so we need to do some cleanup.  
Based on that, I've asked and was told that:

- snapshots of alpha indices should be kept a year
- snapshots of beta and gamma indices should be kept 10 weeks
- snapshots of delta indices (by far the heaviest space consumers) should be kept 6 weeks.

This is all well and good for the new snapshots, I've changed their creation to be separate for each indice type, and so can perform the cleanup for each of those snapshots separately based on the requirements provided,  
but for older snapshots, which contain all the indices types, I'm a bit stuck.  
The option I was considering was to recreate the snapshots per indice type for the ones I wish to keep (mostly alpha indices), so I could then delete the global snapshots while retaining the important information.  
I'd like to know if there is any possibility to do so only working on the information in the repository, instead of having to restore old snapshots, then recreate new ones based on the restored indices.  
Goal for all the historic data will probably be to create snapshots containing a single day of indice type.

If there is a better/more standard approach to achieve my goal, I'm of course happy to hear it, I'm still in the learning phase. 🙂

Thanks in advance for all input,  
Olivier

---

<div class="post-metadata">

**Author:** ![ywelsch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ywelsch/32/7751_2.png) [@ywelsch](https://discuss.elastic.co/u/ywelsch)\
**Post date:** [March 2, 2016, 10:58am UTC](https://discuss.elastic.co/t/snapshot-is-it-possible-to-create-them-based-on-repository-indices/43196/2 "2016-03-02T10:58:33Z")

</div>

> [@vandamo](#):
>
> I'd like to know if there is any possibility to do so only working on the information in the repository, instead of having to restore old snapshots, then recreate new ones based on the restored indices.Goal for all the historic data will probably be to create snapshots containing a single day of indice type.

Unfortunately that's currently not possible. See also the following discussion:

> <https://github.com/elastic/elasticsearch/issues/11148>
>
> \###### Suggestion for more fine-granular manipulation of snapshots:
> 
> Snapshots c…an be partially restored by selecting only a subset of the indices. They can at the moment, however, only be fully deleted. This means that unwanted parts of a snapshot cannot be easily removed. Deleting indices from snapshots would complement the existing functionality.
> 
> Other primitive operations such as moving / copying indices between snapshots might be useful. At the moment, only a single snapshot operation can be active in the cluster. This determines the level of concurrency for backing up as well as restoring data. In a large cluster, the backing up of data might be partitioned into smaller snapshot tasks. This is relevant when prioritizing certain indices or backing up indices with different frequencies. It also helps to minimize the interference with re-balancing processes by backing up individual indices as fast as possible (reduces the amount of transfer time for each individual index). Now if I snapshot the first ten indices and then ten more (e.g. to consider priorities), I will not be able to restore index A of the former snapshot and index B of the latter snapshot at the same time. Moving indices between snapshots would allow the combination of both snapshots.
> \###### What about immutability of snapshots?
> 
> At the moment, snapshots are immutable (they are created as a fixed set of indices). Adding delete / move / copy operations would change that. However, other operations could be imagined that conform to the "immutable" model. For example, creating a new snapshot based on the content of other snapshots (by giving an ordered list of (snapshot, indices) pairs). With the current implementation of snapshots, this would be very fast (only writing meta-data).
> 
> I can make a pull request if this is a feature that others deem useful. Also, the specifics of the operations need to be clarified first.

---

<div class="post-metadata">

**Author:** ![vandamo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vandamo/32/8203_2.png) [@vandamo](https://discuss.elastic.co/u/vandamo)\
**Post date:** [March 2, 2016, 1:04pm UTC](https://discuss.elastic.co/t/snapshot-is-it-possible-to-create-them-based-on-repository-indices/43196/3 "2016-03-02T13:04:01Z")

</div>

Thanks a lot for the reply, and reference content.  
Based on it, I understand I'll have to handle the transition from global snapshots to snapshots per indice type in a fairly manual manner,  
or start to restore / recreate snapshot indices to speed up the space recovery.

---

<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:12pm UTC](https://discuss.elastic.co/t/snapshot-is-it-possible-to-create-them-based-on-repository-indices/43196/4 "2017-07-05T23:12:04Z")

</div>


