# Rename index and create alias for old name

**URL:** <https://discuss.elastic.co/t/rename-index-and-create-alias-for-old-name/321819>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management, reindex\
**Created:** [December 22, 2022, 8:34am UTC](https://discuss.elastic.co/t/rename-index-and-create-alias-for-old-name/321819 "2022-12-22T08:34:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rafi0101](https://avatars.discourse-cdn.com/v4/letter/r/ecccb3/32.png) [@rafi0101](https://discuss.elastic.co/u/rafi0101)\
**Post date:** [December 22, 2022, 8:34am UTC](https://discuss.elastic.co/t/rename-index-and-create-alias-for-old-name/321819/1 "2022-12-22T08:34:47Z")

</div>

Hello together,

Normally we run the following scenario in our elasticserach:  
Index template with rollover alias and lifecycle policy. So for example  
Alias: testindex  
Index: testindex-000001 (current write index for the alias testindex)  
Logstash only knows the alias and always writes to the testindex)

Now I forgot to create the index template and the first index (with suffix -000001) for one index in advance:

Since neither index nor alias existed, the logstash has now created the index: testindex. Which of course is not being rolled over. The index is now about 500GB big and I would like to make an rollover now.

Index Template I am able to create. And now I would have to reindex the current testindex with 500gb (or however I should do that) into an index: testindex-000001 Then delete testindex and set testindex as alias for testindex-000001. Then the ilm should take effect and do a rollover.

In general I would manage this, but the problem is that the logstash is sending new logs all the time and I don't know how to do this without losing data. Unfortunately I can not stop the logstash

I hope it is understandable and someone has an idea how I can best do this 🙂

And yes I know, the index is actually already way too big with 500Gb, but that's a problem for later...

---

<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:** [January 19, 2023, 8:35am UTC](https://discuss.elastic.co/t/rename-index-and-create-alias-for-old-name/321819/2 "2023-01-19T08:35:35Z")

</div>

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