# Reindex from the existing index

**URL:** https://discuss.elastic.co/t/reindex-from-the-existing-index/23026
**Category:** Elasticsearch
**Created:** [April 1, 2015, 4:15am UTC](https://discuss.elastic.co/t/reindex-from-the-existing-index/23026 "2015-04-01T04:15:36Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Vladi\_Feigin](https://avatars.discourse-cdn.com/v4/letter/v/258eb7/32.png) [@Vladi\_Feigin](https://discuss.elastic.co/u/Vladi_Feigin)
#### Post date: [April 1, 2015, 4:15am UTC](https://discuss.elastic.co/t/reindex-from-the-existing-index/23026/1 "2015-04-01T04:15:36Z")

</div>

## Hi, Is there a way to build a new index from the existing index ? Thank you, Vladi

This message may contain confidential and/or privileged information.  
If you are not the addressee or authorized to receive this on behalf of the  
addressee you must not use, copy, disclose or take action based on this  
message or any information herein.  
If you have received this message in error, please advise the sender  
immediately by reply email and delete this message. Thank you.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/9f51ce24-b826-4bcb-8d2c-ab18732e8016%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9f51ce24-b826-4bcb-8d2c-ab18732e8016%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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: [April 1, 2015, 4:50am UTC](https://discuss.elastic.co/t/reindex-from-the-existing-index/23026/2 "2015-04-01T04:50:31Z")

</div>

If you Search on the web site for reindex, you will find this:

> **[Reindexing Your Data | Elasticsearch: The Definitive Guide \[2.x\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/guide/current/reindex.html)**

David

> Le 1 avr. 2015 à 06:15, Vladi Feigin [vladif@liveperson.com](mailto:vladif@liveperson.com) a écrit :
> 
> ## Hi, Is there a way to build a new index from the existing index ? Thank you, Vladi
> 
> This message may contain confidential and/or privileged information.  
> If you are not the addressee or authorized to receive this on behalf of the  
> addressee you must not use, copy, disclose or take action based on this  
> message or any information herein.  
> If you have received this message in error, please advise the sender  
> immediately by reply email and delete this message. Thank you.
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/9f51ce24-b826-4bcb-8d2c-ab18732e8016%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9f51ce24-b826-4bcb-8d2c-ab18732e8016%40googlegroups.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/A8B19DE8-AE00-4482-BB59-09993806309D%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/A8B19DE8-AE00-4482-BB59-09993806309D%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [April 1, 2015, 6:21am UTC](https://discuss.elastic.co/t/reindex-from-the-existing-index/23026/3 "2015-04-01T06:21:13Z")

</div>

On Wednesday, April 01, 2015 at 06:15 CEST,  
Vladi Feigin [vladif@liveperson.com](mailto:vladif@liveperson.com) wrote:

> Is there a way to build a new index from the existing index ?

Elasticsearch doesn't ship with a tool for this purpose nor  
a one-stop-shop API, but there are several wrappers of the  
bulk reindexing API. I've successfully used the es-reindex  
tool and the elasticsearch.helpers.reindex() function from  
the official Python client for ES.

> **[GitHub - geronime/es-reindex: Ruby script to copy ElasticSearch index (reindex).](https://github.com/geronime/es-reindex)**
>
> Ruby script to copy ElasticSearch index (reindex). - GitHub - geronime/es-reindex: Ruby script to copy ElasticSearch index (reindex).

[http://elasticsearch-py.readthedocs.org/en/master/helpers.html](http://elasticsearch-py.readthedocs.org/en/master/helpers.html)

--  
Magnus Bäck | Software Engineer, Development Tools  
[magnus.back@sonymobile.com](mailto:magnus.back@sonymobile.com) | Sony Mobile Communications

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/20150401062112.GC3582%40seldlx20533.corpusers.net](https://groups.google.com/d/msgid/elasticsearch/20150401062112.GC3582%40seldlx20533.corpusers.net).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Anil\_Karaka](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Anil\_Karaka](https://discuss.elastic.co/u/Anil_Karaka)
#### Post date: [April 1, 2015, 6:51am UTC](https://discuss.elastic.co/t/reindex-from-the-existing-index/23026/4 "2015-04-01T06:51:37Z")

</div>

install elasticsearch python plugin

> > > from elasticsearch import Elasticsearch  
> > > form elasticsearch.helpers import reindex  
> > > es = Elasticsearch(["es.node1"])

> > > reindex(es, "source\_index", "target\_index")

this will reindex from source\_index to target\_index, also keep in mind that  
the mappings won't be transferred.

you can specify another target cluster as well.. and a query so that  
documents that only satisfy that query in source index will be reindexed  
into the target index.

more  
documentation [Helpers — Elasticsearch 8.0.0 documentation](https://elasticsearch-py.readthedocs.org/en/master/helpers.html#elasticsearch.helpers.reindex)

On Wednesday, April 1, 2015 at 11:52:26 AM UTC+5:30, Magnus Bäck wrote:

> On Wednesday, April 01, 2015 at 06:15 CEST,  
> Vladi Feigin \<[vla...@liveperson.com](mailto:vla...@liveperson.com) \<javascript:\>\> wrote:
> 
> > Is there a way to build a new index from the existing index ?
> 
> Elasticsearch doesn't ship with a tool for this purpose nor  
> a one-stop-shop API, but there are several wrappers of the  
> bulk reindexing API. I've successfully used the es-reindex  
> tool and the elasticsearch.helpers.reindex() function from  
> the official Python client for ES.
> 
> [GitHub - geronime/es-reindex: Ruby script to copy ElasticSearch index (reindex).](https://github.com/geronime/es-reindex)  
> [Helpers — Elasticsearch 8.0.0 documentation](http://elasticsearch-py.readthedocs.org/en/master/helpers.html)
> 
> --  
> Magnus Bäck | Software Engineer, Development Tools  
> [magnu...@sonymobile.com](mailto:magnu...@sonymobile.com) \<javascript:\> | Sony Mobile Communications

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d840f503-2e41-4ea2-afc3-4a1135b873ce%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d840f503-2e41-4ea2-afc3-4a1135b873ce%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:22am UTC](https://discuss.elastic.co/t/reindex-from-the-existing-index/23026/5 "2017-07-06T00:22:27Z")

</div>


