# Reindex thousands of indices into a shared stream

**URL:** <https://discuss.elastic.co/t/reindex-thousands-of-indices-into-a-shared-stream/270507>\
**Category:** Elasticsearch\
**Created:** [April 18, 2021, 7:11pm UTC](https://discuss.elastic.co/t/reindex-thousands-of-indices-into-a-shared-stream/270507 "2021-04-18T19:11:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![liorg2](https://avatars.discourse-cdn.com/v4/letter/l/ed8c4c/32.png) [@liorg2](https://discuss.elastic.co/u/liorg2)\
**Post date:** [April 18, 2021, 7:11pm UTC](https://discuss.elastic.co/t/reindex-thousands-of-indices-into-a-shared-stream/270507/1 "2021-04-18T19:11:57Z")

</div>

Hello

I'm trying to achieve the following:  
reindex 3000 indices (between 100 mb to 5gb), which contains data for the years 2019-2021, into a shared stream.  
Ideally the target stream needs to be sorted by date, so the ILM will rollover the backend indices correctly by size+age

The reindex api, has a deprecated sort param, and rather than that, I'm getting different errors when trying to use it , and I think that 3000 indices are maybe too much for a single call.

I wrote a script that runs a reindex hour by hour for each client (not too fast), and I wonder if there is a better option

thanks!  
p.s can the [index sorting](https://www.elastic.co/guide/en/elasticsearch/reference/master/index-modules-index-sorting.html#index-modules-index-sorting) help in this case?

---

<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:** [May 16, 2021, 7:12pm UTC](https://discuss.elastic.co/t/reindex-thousands-of-indices-into-a-shared-stream/270507/2 "2021-05-16T19:12:38Z")

</div>

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