# Reindex / Consolidate Indizes

**URL:** <https://discuss.elastic.co/t/reindex-consolidate-indizes/255544>\
**Category:** Elasticsearch\
**Created:** [November 16, 2020, 1:39pm UTC](https://discuss.elastic.co/t/reindex-consolidate-indizes/255544 "2020-11-16T13:39:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ksremo](https://avatars.discourse-cdn.com/v4/letter/k/5fc32e/32.png) [@ksremo](https://discuss.elastic.co/u/ksremo)\
**Post date:** [November 16, 2020, 1:39pm UTC](https://discuss.elastic.co/t/reindex-consolidate-indizes/255544/1 "2020-11-16T13:39:08Z")

</div>

How to migrate from multiple timebased indizes

`<name>-<yyyymmdd>` to a single `<name>` index without losing data?

---

<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:** [November 16, 2020, 2:05pm UTC](https://discuss.elastic.co/t/reindex-consolidate-indizes/255544/2 "2020-11-16T14:05:38Z")

</div>

What about using an index alias instead? So you don't need to reindex anything...

---

<div class="post-metadata">

**Author:** ![ksremo](https://avatars.discourse-cdn.com/v4/letter/k/5fc32e/32.png) [@ksremo](https://discuss.elastic.co/u/ksremo)\
**Post date:** [November 16, 2020, 2:21pm UTC](https://discuss.elastic.co/t/reindex-consolidate-indizes/255544/4 "2020-11-16T14:21:59Z")

</div>

There is an oversharding problem. Initial we design daily indizes. Now we want to switch to weekly indizes. So alias wont help ☹

---

<div class="post-metadata">

**Author:** ![flavienbwk](https://avatars.discourse-cdn.com/v4/letter/f/5f9b8f/32.png) [@flavienbwk](https://discuss.elastic.co/u/flavienbwk)\
**Post date:** [November 16, 2020, 2:24pm UTC](https://discuss.elastic.co/t/reindex-consolidate-indizes/255544/5 "2020-11-16T14:24:06Z")

</div>

If you are forced to re-inject, I recommend you to use [`elasticsearch-dump`](https://github.com/elasticsearch-dump/elasticsearch-dump).

---

<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:** [November 16, 2020, 2:53pm UTC](https://discuss.elastic.co/t/reindex-consolidate-indizes/255544/6 "2020-11-16T14:53:12Z")

</div>

I see. Out of curiosity,

What is the output of:

```auto
GET /
GET /_cat/nodes?v
GET /_cat/health?v
GET /_cat/indices?v

```

If some outputs are too big, please share them on [gist.github.com](http://gist.github.com) and link them here.

One short solution could be use the shrink API.

But yes, you can use the reindex API if you need.

- Create a new weekly index (with the right settings/mappings)
- Change the application which generates the data to write to this index
- Use the reindex API to reindex your daily indices to the weekly index
- Drop the daily indices

For the future I'd recommend using Index lifecycle Management (ILM).

---

<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:** [December 14, 2020, 2:53pm UTC](https://discuss.elastic.co/t/reindex-consolidate-indizes/255544/7 "2020-12-14T14:53:26Z")

</div>

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