# Migrate elastic search data from one cluster to other

**URL:** <https://discuss.elastic.co/t/migrate-elastic-search-data-from-one-cluster-to-other/171301>\
**Category:** Elasticsearch\
**Created:** [March 7, 2019, 12:30pm UTC](https://discuss.elastic.co/t/migrate-elastic-search-data-from-one-cluster-to-other/171301 "2019-03-07T12:30:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Parvatayya\_Malimath](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/parvatayya_malimath/32/49330_2.png) [@Parvatayya\_Malimath](https://discuss.elastic.co/u/Parvatayya_Malimath)\
**Post date:** [March 7, 2019, 12:30pm UTC](https://discuss.elastic.co/t/migrate-elastic-search-data-from-one-cluster-to-other/171301/1 "2019-03-07T12:30:14Z")

</div>

Hi,

We have 3 node elastic search cluster and for certain reason we have to get rid of those VMs, now i need to migrate the data from the existing cluster to new one without a down time.

I thought of adding 3 new nodes to the existing cluster and then shut down the existing nodes one by one. is this a good idea at all?  
or  
please suggest a best method.

---

<div class="post-metadata">

**Author:** ![xavierfacq](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xavierfacq/32/8744_2.png) [@xavierfacq](https://discuss.elastic.co/u/xavierfacq)\
**Post date:** [March 7, 2019, 1:50pm UTC](https://discuss.elastic.co/t/migrate-elastic-search-data-from-one-cluster-to-other/171301/2 "2019-03-07T13:50:14Z")

</div>

Hi,

Yes, it's the easy way.

1°/ Add new nodes in your cluster, with master eligible and data flags enable.

2°/ Exclude old nodes on by one from the cluster, this will move shards to new nodes:

> curl -XPUT '[http://ip-new-node:9200/\_cluster/settings?pretty](http://ip-new-node:9200/_cluster/settings?pretty)' -H "Content-Type: application/json" -d '  
> {  
> "transient" : {  
> "cluster.routing.allocation.exclude.\_name" : "name-of-an-old-node"  
> }  
> }'

When the old node doesn't have data anymore, you can stop the service and stop the machine !

Repeat 3x for your 3 old nodes.

bye,  
Xavier

---

<div class="post-metadata">

**Author:** ![Parvatayya\_Malimath](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/parvatayya_malimath/32/49330_2.png) [@Parvatayya\_Malimath](https://discuss.elastic.co/u/Parvatayya_Malimath)\
**Post date:** [March 7, 2019, 2:55pm UTC](https://discuss.elastic.co/t/migrate-elastic-search-data-from-one-cluster-to-other/171301/3 "2019-03-07T14:55:04Z")

</div>

Thanks a lot, @xavierfacq  
One quick question. should i stop logstash from feeding the old ES node? before I do the second step. I am bit confused at that.?

regards  
Parvat

---

<div class="post-metadata">

**Author:** ![xavierfacq](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xavierfacq/32/8744_2.png) [@xavierfacq](https://discuss.elastic.co/u/xavierfacq)\
**Post date:** [March 7, 2019, 4:24pm UTC](https://discuss.elastic.co/t/migrate-elastic-search-data-from-one-cluster-to-other/171301/4 "2019-03-07T16:24:40Z")

</div>

> [@Parvatayya\_Malimath](#):
>
> One quick question. should i stop logstash from feeding the old ES node? before I do the second step. I am bit confused at that.?

Not certain, but it's quite possible that Logstash will see new nodes even if you stop the old. But, I think that you shoud restart your Logstash with new nodes IPS before stopping old nodes.

bye,  
Xavier

---

<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:** [April 4, 2019, 4:24pm UTC](https://discuss.elastic.co/t/migrate-elastic-search-data-from-one-cluster-to-other/171301/5 "2019-04-04T16:24:42Z")

</div>

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