# Reindexing over 80 indices with one script

**URL:** <https://discuss.elastic.co/t/reindexing-over-80-indices-with-one-script/188711>\
**Category:** Elasticsearch\
**Created:** [July 3, 2019, 12:53pm UTC](https://discuss.elastic.co/t/reindexing-over-80-indices-with-one-script/188711 "2019-07-03T12:53:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![SCL\_ADMIN](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/scl_admin/32/49037_2.png) [@SCL\_ADMIN](https://discuss.elastic.co/u/SCL_ADMIN)\
**Post date:** [July 3, 2019, 12:53pm UTC](https://discuss.elastic.co/t/reindexing-over-80-indices-with-one-script/188711/1 "2019-07-03T12:53:25Z")

</div>

I've upgraded to version 7.2 from 6.6.1

in the upgrade assistant via Kibana 7.2 it shows that indices should be re-index to at least version 7.

the question is, how can re-index 80 indices in a single command or script? is it possible?

---

<div class="post-metadata">

**Author:** ![Gidi\_Kalef](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gidi_kalef/32/43651_2.png) [@Gidi\_Kalef](https://discuss.elastic.co/u/Gidi_Kalef)\
**Post date:** [July 3, 2019, 2:15pm UTC](https://discuss.elastic.co/t/reindexing-over-80-indices-with-one-script/188711/2 "2019-07-03T14:15:03Z")

</div>

Yes,  
First, you can create a bash script using curl  
Second you can use POST \_REINDEX api , attaching document:  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html)

---

<div class="post-metadata">

**Author:** ![SCL\_ADMIN](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/scl_admin/32/49037_2.png) [@SCL\_ADMIN](https://discuss.elastic.co/u/SCL_ADMIN)\
**Post date:** [July 3, 2019, 2:55pm UTC](https://discuss.elastic.co/t/reindexing-over-80-indices-with-one-script/188711/3 "2019-07-03T14:55:54Z")

</div>

Thanks, I've found an example at the bottom of the guide.....

but when I run this will it automatically append the mapping type to \_doc ?

---

<div class="post-metadata">

**Author:** ![Gidi\_Kalef](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gidi_kalef/32/43651_2.png) [@Gidi\_Kalef](https://discuss.elastic.co/u/Gidi_Kalef)\
**Post date:** [July 3, 2019, 3:24pm UTC](https://discuss.elastic.co/t/reindexing-over-80-indices-with-one-script/188711/4 "2019-07-03T15:24:40Z")

</div>

Yes, in case in your template there is correct mapping

---

<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:** [July 31, 2019, 3:24pm UTC](https://discuss.elastic.co/t/reindexing-over-80-indices-with-one-script/188711/5 "2019-07-31T15:24:46Z")

</div>

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