# \[Solved\] How can i do a manual rollover for all indices to the newest index policy?

**URL:** <https://discuss.elastic.co/t/solved-how-can-i-do-a-manual-rollover-for-all-indices-to-the-newest-index-policy/184694>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [June 7, 2019, 6:20am UTC](https://discuss.elastic.co/t/solved-how-can-i-do-a-manual-rollover-for-all-indices-to-the-newest-index-policy/184694 "2019-06-07T06:20:52Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![TsuWeiQuan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsuweiquan/32/46252_2.png) [@TsuWeiQuan](https://discuss.elastic.co/u/TsuWeiQuan)\
**Post date:** [June 7, 2019, 6:42am UTC](https://discuss.elastic.co/t/solved-how-can-i-do-a-manual-rollover-for-all-indices-to-the-newest-index-policy/184694/2 "2019-06-07T06:42:46Z")

</div>

After reading up on the [Rollover Index API](https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-rollover-index.html) portion of the documentation, i found my answer!

Apparently i just have to run

```
POST /filebeat-esnode1/_rollover 
{
  "conditions": {
    "max_age": "1d",
    "max_size": "1gb"
  }
}

```

where `filebeat-esnode1` is the rollover alias of the index.  
I now see new index being created.

Running this process for all indices that belong to the policy will upgrade all indices version.

Using `GET filebeat-esnode1/_ilm/explain` & `GET _ilm/policy/filebeat-7.0.1` in the console allows me to cross check! 🙂

Edit--  
However, doing a manual rollover will cause lifecycle error as shown :

```
Index lifecycle error
illegal_argument_exception: index [filebeat-esnode1] is not the write index for alias [filebeat-esnode1-2019.05.29-000001]

```

To solve this,

> [@Index management error: "Index is not the write index for alias"](https://discuss.elastic.co/t/index-management-error-index-is-not-the-write-index-for-alias/180894/3):
>
> you can set `index.lifecycle.indexing_complete` to `true` and use the [Retry API](https://www.elastic.co/guide/en/elasticsearch/reference/6.8/ilm-retry-policy.html) to allow ILM to skip rollover in this case.

via [this post](https://discuss.elastic.co/t/index-management-error-index-is-not-the-write-index-for-alias/180894/2)

---

_[View the full topic](https://discuss.elastic.co/t/solved-how-can-i-do-a-manual-rollover-for-all-indices-to-the-newest-index-policy/184694)._
