# ES 6.2.1 Advice deleting old index after a reindex

**URL:** <https://discuss.elastic.co/t/es-6-2-1-advice-deleting-old-index-after-a-reindex/122392>\
**Category:** Elasticsearch\
**Created:** [March 4, 2018, 12:12am UTC](https://discuss.elastic.co/t/es-6-2-1-advice-deleting-old-index-after-a-reindex/122392 "2018-03-04T00:12:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ld\_pvl](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@ld\_pvl](https://discuss.elastic.co/u/ld_pvl)\
**Post date:** [March 4, 2018, 12:12am UTC](https://discuss.elastic.co/t/es-6-2-1-advice-deleting-old-index-after-a-reindex/122392/1 "2018-03-04T00:12:49Z")

</div>

Hi Team,

I would like to compress indexes when they become old.

The problem I have at the moment is I think the only way to compress an old index is to do a reindex to create a new index with best compression index codec and then, as a separate second step, delete the old original index.

This is a problem for me as when I use curator to try to do these two actions, even when I set the reindex action to wait for completion and not to continue if there's any exceptions, I have experienced times when curator proceeds to the delete action when the reindex has not completed therefore indexes are deleted prematurely hence data is lost.

Is there a way to do a reindex + deletion in a single atomic fashion?

Cheers,

---

<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:** [March 4, 2018, 12:16am UTC](https://discuss.elastic.co/t/es-6-2-1-advice-deleting-old-index-after-a-reindex/122392/2 "2018-03-04T00:16:14Z")

</div>

Actually, you can do something like:

- Closing the index
- Change the `index.codec` setting
- Open the index
- Run a `_forcemerge` call

Would that work for you?

---

<div class="post-metadata">

**Author:** ![ld\_pvl](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@ld\_pvl](https://discuss.elastic.co/u/ld_pvl)\
**Post date:** [March 4, 2018, 12:31am UTC](https://discuss.elastic.co/t/es-6-2-1-advice-deleting-old-index-after-a-reindex/122392/3 "2018-03-04T00:31:17Z")

</div>

Many thanks David,

I never knew I could do that - that sounds great.

One more question please, is it possible to rename an index without reindexing?

---

<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:** [March 4, 2018, 12:47am UTC](https://discuss.elastic.co/t/es-6-2-1-advice-deleting-old-index-after-a-reindex/122392/4 "2018-03-04T00:47:29Z")

</div>

No but you can use alias.

---

<div class="post-metadata">

**Author:** ![ld\_pvl](https://avatars.discourse-cdn.com/v4/letter/l/cdc98d/32.png) [@ld\_pvl](https://discuss.elastic.co/u/ld_pvl)\
**Post date:** [March 4, 2018, 12:50am UTC](https://discuss.elastic.co/t/es-6-2-1-advice-deleting-old-index-after-a-reindex/122392/5 "2018-03-04T00:50:32Z")

</div>

Thanks David

---

<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:** [April 1, 2018, 12:51am UTC](https://discuss.elastic.co/t/es-6-2-1-advice-deleting-old-index-after-a-reindex/122392/6 "2018-04-01T00:51:01Z")

</div>

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