# Create ILM Rollover on existing index

**URL:** <https://discuss.elastic.co/t/create-ilm-rollover-on-existing-index/280814>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [August 9, 2021, 2:06pm UTC](https://discuss.elastic.co/t/create-ilm-rollover-on-existing-index/280814 "2021-08-09T14:06:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Baygon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/baygon/32/91792_2.png) [@Baygon](https://discuss.elastic.co/u/Baygon)\
**Post date:** [August 9, 2021, 2:06pm UTC](https://discuss.elastic.co/t/create-ilm-rollover-on-existing-index/280814/1 "2021-08-09T14:06:48Z")

</div>

Hi,

I have an existing index that grows too big and I see perf going down (the index is 85Gb for the moment).

I created an IL policy, and now trying to create an index template to apply the policy on.

Given the existing index called mydocs, my index template settings look like that:

```auto
{
  "settings": {
    "index": {
      "lifecycle": {
        "name": "mydocs-index-rollover-policy",
        "rollover_alias": "mydocs"
      },
      "number_of_shards": "1",
      "number_of_replicas": "1"
    }
  },
  "aliases": {
      "mydocs": {
          "is_write_index": true
      }
  },
  "mappings": {}
}

```

However I get the following error:

> "Invalid alias name [mydocs], an index exists with the same name as the alias"

What would be the correct approach to create this rollover?

---

<div class="post-metadata">

**Author:** ![Stef\_Nestor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stef_nestor/32/85483_2.png) [@Stef\_Nestor](https://discuss.elastic.co/u/Stef_Nestor)\
**Post date:** [August 9, 2021, 2:52pm UTC](https://discuss.elastic.co/t/create-ilm-rollover-on-existing-index/280814/2 "2021-08-09T14:52:30Z")

</div>

Howdy @Baygon,

It sounds like if you did a [Cat Indices](https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-indices.html) you would find an index named "mydocs" which is why the system's preventing you from creating an alias of the same name. (You can check current alias names via [Cat Aliases](https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-alias.html)).

Your index aliases should be uniquely named from index names. Indices with rollover will format example `INDEX_NAME-000001` (note the suffixing digit format) with `INDEX_ALIAS`. Here's an [example walk through from our blog](https://www.elastic.co/blog/troubleshooting-elasticsearch-ilm-common-issues-and-fixes).

---

<div class="post-metadata">

**Author:** ![Baygon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/baygon/32/91792_2.png) [@Baygon](https://discuss.elastic.co/u/Baygon)\
**Post date:** [August 10, 2021, 12:31am UTC](https://discuss.elastic.co/t/create-ilm-rollover-on-existing-index/280814/3 "2021-08-10T00:31:22Z")

</div>

Thanks for your response.

Sure I can make the rollover alias unique, however how does it know that for start it should use the mydocs index (which already contains 85Gb of data)?

Or is it not possible to create rollover on an already existing index?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 10, 2021, 1:17am UTC](https://discuss.elastic.co/t/create-ilm-rollover-on-existing-index/280814/4 "2021-08-10T01:17:33Z")

</div>

[Manage existing indices | Elasticsearch Guide [7.14] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.14/ilm-with-existing-indices.html) is the best place to start for managing existing indices with ILM.

---

<div class="post-metadata">

**Author:** ![Baygon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/baygon/32/91792_2.png) [@Baygon](https://discuss.elastic.co/u/Baygon)\
**Post date:** [August 10, 2021, 12:11pm UTC](https://discuss.elastic.co/t/create-ilm-rollover-on-existing-index/280814/5 "2021-08-10T12:11:19Z")

</div>

Got it, you basically need to do a reindex into a new one.  
So I guess I'll also need to change the index name that my queries are pinging, thanks.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 10, 2021, 11:02pm UTC](https://discuss.elastic.co/t/create-ilm-rollover-on-existing-index/280814/6 "2021-08-10T23:02:52Z")

</div>

You shouldn't need to do that, no.

---

<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 7, 2021, 11:03pm UTC](https://discuss.elastic.co/t/create-ilm-rollover-on-existing-index/280814/7 "2021-09-07T23:03:20Z")

</div>

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