# Archiving OLD data

**URL:** <https://discuss.elastic.co/t/archiving-old-data/141854>\
**Category:** Elasticsearch\
**Created:** [July 26, 2018, 11:16pm UTC](https://discuss.elastic.co/t/archiving-old-data/141854 "2018-07-26T23:16:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sujatharudra](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@sujatharudra](https://discuss.elastic.co/u/sujatharudra)\
**Post date:** [July 26, 2018, 11:16pm UTC](https://discuss.elastic.co/t/archiving-old-data/141854/1 "2018-07-26T23:16:31Z")

</div>

Can you help me with how to archive data with compression works in elasticsearch.

My cluster have all physical boxes .

I am trying to archive last month indices for querying in case we need it.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 27, 2018, 12:12am UTC](https://discuss.elastic.co/t/archiving-old-data/141854/2 "2018-07-27T00:12:20Z")

</div>

Have a look at curator project which can help I think to automate that.

---

<div class="post-metadata">

**Author:** ![sujatharudra](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@sujatharudra](https://discuss.elastic.co/u/sujatharudra)\
**Post date:** [July 27, 2018, 2:13am UTC](https://discuss.elastic.co/t/archiving-old-data/141854/3 "2018-07-27T02:13:17Z")

</div>

We didn't buy the licence, Appreciate for any other alternatives.

Thanks.

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [July 27, 2018, 2:30am UTC](https://discuss.elastic.co/t/archiving-old-data/141854/4 "2018-07-27T02:30:47Z")

</div>

Curator requires no license. It is fully Open Source.

---

<div class="post-metadata">

**Author:** ![akhileshsingh](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@akhileshsingh](https://discuss.elastic.co/u/akhileshsingh)\
**Post date:** [July 30, 2018, 5:18am UTC](https://discuss.elastic.co/t/archiving-old-data/141854/6 "2018-07-30T05:18:31Z")

</div>

hi @sujatharudra,

> [@sujatharudra](#):
>
> Can you help me with how to archive data with compression works in elasticsearch.

Yes, you can archive data in elasticsearch by using curator.  
And by using shrink action you can archive data according to you need.

Shrink action is used to reduce the existing index into new index with few primary shard. Several conditions need to be met in order for index shrinking to take place:  
• The index must be marked as read-only  
• A (primary or replica) copy of every shard in the index must be relocated to the same node  
• The cluster must have health green  
• The target index must not exist  
• The number of primary shards in the target index must be a factor of the number of primary shards in the source index.  
• The number\_of\_shards of the target index must be specified less than source index's one.  
• The index must not contain more than 2,147,483,519 documents in total across all shards that will be shrunk into a single shard on the target index as this is the maximum number of docs that can fit into a single shard.  
• The node handling the shrink process must have sufficient free disk space to accommodate a second copy of the existing index.

you can also follow the below shrink action template to archive data.

> action: shrink  
> description: \>-  
> Shrink selected indices on the node with the most available space.  
> Delete source index after successful shrink, then reroute the shrunk  
> index with the provided parameters.  
> options:  
> ignore\_empty\_list: True  
> shrink\_node: DETERMINISTIC  
> node\_filters:  
> permit\_masters: False  
> exclude\_nodes: ['not\_this\_node']  
> number\_of\_shards: 1  
> number\_of\_replicas: 1  
> shrink\_prefix:  
> shrink\_suffix: '-shrink'  
> delete\_after: True  
> post\_allocation:  
> allocation\_type: include  
> key: node\_tag  
> value: cold  
> wait\_for\_active\_shards: 1  
> extra\_settings:  
> settings:  
> index.codec: best\_compression  
> wait\_for\_completion: True  
> wait\_for\_rebalance: True  
> wait\_interval: 9  
> max\_wait: -1  
> filters:
> 
> - filtertype: ...

for more information you can also follow the below link:

> **[Shrink | Curator Reference \[5.5\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/client/curator/5.5/shrink.html)**

I hope the above steps will help you.

Thanks.

---

<div class="post-metadata">

**Author:** ![sujatharudra](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@sujatharudra](https://discuss.elastic.co/u/sujatharudra)\
**Post date:** [August 9, 2018, 10:35pm UTC](https://discuss.elastic.co/t/archiving-old-data/141854/7 "2018-08-09T22:35:14Z")

</div>

> [@akhileshsingh](#):
>
> you can also follow the below shrink action template to archive data.
> 
> > action: shrink

can you suggest me with out curator

---

<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:** [September 6, 2018, 10:35pm UTC](https://discuss.elastic.co/t/archiving-old-data/141854/8 "2018-09-06T22:35:18Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
