# Script to scan a whole index and migrate it to another index

**URL:** <https://discuss.elastic.co/t/script-to-scan-a-whole-index-and-migrate-it-to-another-index/6019>\
**Category:** Elasticsearch\
**Created:** [November 30, 2011, 6:27am UTC](https://discuss.elastic.co/t/script-to-scan-a-whole-index-and-migrate-it-to-another-index/6019 "2011-11-30T06:27:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vineeth\_mohan](https://avatars.discourse-cdn.com/v4/letter/v/bc79bd/32.png) [@vineeth\_mohan](https://discuss.elastic.co/u/vineeth_mohan)\
**Post date:** [November 30, 2011, 6:27am UTC](https://discuss.elastic.co/t/script-to-scan-a-whole-index-and-migrate-it-to-another-index/6019/1 "2011-11-30T06:27:58Z")

</div>

Hi ,

Is there a script which does this ?

If there is not , i am willing to write one and contribute.

Thanks  
Vineeth

---

<div class="post-metadata">

**Author:** ![Karussell1](https://avatars.discourse-cdn.com/v4/letter/k/50afbb/32.png) [@Karussell1](https://discuss.elastic.co/u/Karussell1)\
**Post date:** [November 30, 2011, 9:02am UTC](https://discuss.elastic.co/t/script-to-scan-a-whole-index-and-migrate-it-to-another-index/6019/2 "2011-11-30T09:02:13Z")

</div>

There is a perl script I think (see the perl client) and there is some  
java code which merges indices (can be used to copy of course too)

> <https://github.com/karussell/Jetwick/blob/master/src/main/java/de/jetwick/es/AbstractElasticSearch.java#L308>

Peter.

On 30 Nov., 07:27, Vineeth Mohan [vineethmo...@algotree.com](mailto:vineethmo...@algotree.com) wrote:

> Hi ,
> 
> Is there a script which does this ?
> 
> If there is not , i am willing to write one and contribute.
> 
> Thanks  
> Vineeth

---

<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 6, 2017, 3:46am UTC](https://discuss.elastic.co/t/script-to-scan-a-whole-index-and-migrate-it-to-another-index/6019/3 "2017-07-06T03:46:58Z")

</div>

Closed on July 6, 2017, 3:46am UTC


