# How to apply new ILM policy to existing datastream index

**URL:** <https://discuss.elastic.co/t/how-to-apply-new-ilm-policy-to-existing-datastream-index/371531>\
**Category:** Elasticsearch\
**Created:** [December 5, 2024, 11:50am UTC](https://discuss.elastic.co/t/how-to-apply-new-ilm-policy-to-existing-datastream-index/371531 "2024-12-05T11:50:35Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![racitup](https://avatars.discourse-cdn.com/v4/letter/r/c37758/32.png) [@racitup](https://discuss.elastic.co/u/racitup)\
**Post date:** [December 5, 2024, 11:55am UTC](https://discuss.elastic.co/t/how-to-apply-new-ilm-policy-to-existing-datastream-index/371531/2 "2024-12-05T11:55:37Z")

</div>

Inspired by this topic:

> [@How can I add a ilm policy to an existing datastream index](https://discuss.elastic.co/t/how-can-i-add-a-ilm-policy-to-an-existing-datastream-index/316931):
>
> Some how I have got an index (currently being written) in a data stream which does not have an ilm setting and therefore is not getting rolled over. It is unclear to me what I should do. When I tried to close the index I got dire warnings about closing system indexes.

I went into kibana -\> Index Management -\> [index name] -\> Manage index

There was an option to `Remove lifecycle policy` - do that

Unlike the above post I didn't need to close the index first, it worked while it was open

After that the view and option changes to `Add lifecycle policy` - do that  
It allows you to select the updated lifecycle policy and gives a warning that I ignored:

> Index has no aliases
> 
> Policy filebeat is configured for rollover, but index .ds-filebeat-8.16.0-2024.11.19-000001 does not have an alias, which is required for rollover.

(it seems this is an incorrect warning because a datastream doesn't need/have an alias)

After a few minutes elasticsearch had gone through the lifecycle actions and rolled the index over. Woohoo!

---

_[View the full topic](https://discuss.elastic.co/t/how-to-apply-new-ilm-policy-to-existing-datastream-index/371531)._
