# Data movement between indexes in elasticsearch

**URL:** <https://discuss.elastic.co/t/data-movement-between-indexes-in-elasticsearch/51423>\
**Category:** Elasticsearch\
**Created:** [May 31, 2016, 11:45am UTC](https://discuss.elastic.co/t/data-movement-between-indexes-in-elasticsearch/51423 "2016-05-31T11:45:24Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![gayathri](https://avatars.discourse-cdn.com/v4/letter/g/838e76/32.png) [@gayathri](https://discuss.elastic.co/u/gayathri)\
**Post date:** [May 31, 2016, 11:45am UTC](https://discuss.elastic.co/t/data-movement-between-indexes-in-elasticsearch/51423/1 "2016-05-31T11:45:24Z")

</div>

Hi,  
We are looking to move data from one index to another index in the same server with changed mapping template...

We have tried the below link after creating alias in the index and reassign the alias

> **[Changing Mapping with Zero Downtime
	  	 | Elastic](https://www.elastic.co/blog/changing-mapping-with-zero-downtime)**
>
> Update November 2, 2015: Make sure to check out the updates with Elasticsearch mappings introduced in the 2.0 release.Update May 1, 2017: This blog was originally published several major versions...

But the data is not getting transfered after using the below

curl -XPOST localhost:9200/\_aliases -d '  
{  
"actions": [  
{ "remove": {  
"alias": "my\_index",  
"index": "my\_index\_v1"  
}},  
{ "add": {  
"alias": "my\_index",  
"index": "my\_index\_v2"  
}}  
]  
}

Thanks  
Gayathri

---

<div class="post-metadata">

**Author:** ![thiago](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago/32/32096_2.png) [@thiago](https://discuss.elastic.co/u/thiago)\
**Post date:** [May 31, 2016, 12:32pm UTC](https://discuss.elastic.co/t/data-movement-between-indexes-in-elasticsearch/51423/2 "2016-05-31T12:32:29Z")

</div>

Hello Gayathri,

The aliases api is just a way of adding/removing different names for the same index, it won't do anything with your data. The blog post you mentioned requires that you reindex the data yourself.

If you want elasticsearch to reindex and you are using v2.3, then you may try the new Reindex API [https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html)

Cheers

---

<div class="post-metadata">

**Author:** ![gayathri](https://avatars.discourse-cdn.com/v4/letter/g/838e76/32.png) [@gayathri](https://discuss.elastic.co/u/gayathri)\
**Post date:** [June 1, 2016, 6:48am UTC](https://discuss.elastic.co/t/data-movement-between-indexes-in-elasticsearch/51423/3 "2016-06-01T06:48:25Z")

</div>

Hi,

I am using elasticsearch version 1.5.2... i want to change the mapping of an existing index. How is this possible?

Thanks  
Gayathri

---

<div class="post-metadata">

**Author:** ![gayathri](https://avatars.discourse-cdn.com/v4/letter/g/838e76/32.png) [@gayathri](https://discuss.elastic.co/u/gayathri)\
**Post date:** [June 1, 2016, 7:12am UTC](https://discuss.elastic.co/t/data-movement-between-indexes-in-elasticsearch/51423/4 "2016-06-01T07:12:41Z")

</div>

i tried "\_reindex" but getting below errors:

nested: InvalidIndexNameException[[\_index] Invalid index name [_index], must not start with '_']; ","status":400}

---

<div class="post-metadata">

**Author:** ![gayathri](https://avatars.discourse-cdn.com/v4/letter/g/838e76/32.png) [@gayathri](https://discuss.elastic.co/u/gayathri)\
**Post date:** [June 1, 2016, 7:19am UTC](https://discuss.elastic.co/t/data-movement-between-indexes-in-elasticsearch/51423/5 "2016-06-01T07:19:43Z")

</div>

i tried the below command:

curl -XPOST 'localhost:9201/\_index' -d '{"source":{ "index":"old\_index"},"dest":{"index":"new\_index"}}'

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [June 1, 2016, 7:19am UTC](https://discuss.elastic.co/t/data-movement-between-indexes-in-elasticsearch/51423/6 "2016-06-01T07:19:51Z")

</div>

The reindex API is not available in Elasticsearch 1.5.2, which is why you are getting the error. You should however be able to use Logstash to reindex as per Mark's [example configuration](https://gist.github.com/markwalkom/8a7201e3f6ea4354ae06).

---

<div class="post-metadata">

**Author:** ![gayathri](https://avatars.discourse-cdn.com/v4/letter/g/838e76/32.png) [@gayathri](https://discuss.elastic.co/u/gayathri)\
**Post date:** [June 16, 2016, 7:31am UTC](https://discuss.elastic.co/t/data-movement-between-indexes-in-elasticsearch/51423/7 "2016-06-16T07:31:43Z")

</div>

OK Thanks

---

<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 5, 2017, 10:43pm UTC](https://discuss.elastic.co/t/data-movement-between-indexes-in-elasticsearch/51423/8 "2017-07-05T22:43:26Z")

</div>


