# How to migrate old elastic search index to new version of elastic search?

**URL:** <https://discuss.elastic.co/t/how-to-migrate-old-elastic-search-index-to-new-version-of-elastic-search/7877>\
**Category:** Elasticsearch\
**Created:** [May 28, 2012, 5:12am UTC](https://discuss.elastic.co/t/how-to-migrate-old-elastic-search-index-to-new-version-of-elastic-search/7877 "2012-05-28T05:12:37Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sumit\_Guptaa](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@Sumit\_Guptaa](https://discuss.elastic.co/u/Sumit_Guptaa)\
**Post date:** [May 28, 2012, 5:12am UTC](https://discuss.elastic.co/t/how-to-migrate-old-elastic-search-index-to-new-version-of-elastic-search/7877/1 "2012-05-28T05:12:37Z")

</div>

hi all,

Essentially I cannot find documents or resources that explains the procedure of upgrading a running Elastic search instance into the current version.

Please help me out in a few scenarios:-

1 If I am running an Elastic search instance in a single server, how do I upgrade the instance and not lose data?

2 If I am running multiple Elasticsearch instances in a number of servers, how do I keep my operations running, while I upgrade my Elasticsearch instances without losing data?

if there are proper procedures or explanations on this it will greatly help my understanding and work. Thanks!

Regards,  
Sumit Gupta

---

<div class="post-metadata">

**Author:** ![sujoysett](https://avatars.discourse-cdn.com/v4/letter/s/2acd7d/32.png) [@sujoysett](https://discuss.elastic.co/u/sujoysett)\
**Post date:** [May 28, 2012, 6:45am UTC](https://discuss.elastic.co/t/how-to-migrate-old-elastic-search-index-to-new-version-of-elastic-search/7877/2 "2012-05-28T06:45:48Z")

</div>

Hi,

I have recently upgraded my ES indices from elasticsearch 0.18.6 to 0.19.2,  
and the procedure followed was:

- Stop indexing operations on the indices, run refresh and flush on the  
indices (at cluster level)
- Stop all the nodes.
- Upgrade all the nodes to next version. (In my case data location was  
separate, so no copying of data needed, only in the new version config file  
I had to mention the existing data location.)
- Start the nodes (new version).

The above steps will work for case 1. But there will be a downtime.

For case 2, a more complex procedure is available, but I have NOT tried it  
personally at production level. I had success with it at Development stage.

- First ensure replicas of all the shards exists in all the nodes,  
change replica count if necessary for this and wait until green.
- Of the multiple available nodes, shut down some, and change the  
cluster name in configuration file as well as in local data folder.
- This will prevent these nodes from interfering with existing active  
ones due to mismatch in cluster name. Proceed with upgrading these set of  
nodes while the others serve your application.
- Once you make these upgraded nodes running, shut down the rest and  
proceed for upgrading them also.

These steps worked for us as we were using pure http client (no java API,  
so changing cluster name did not create problem), and using  
commons-httpclient-failover for the requests can help in switching over  
automatically. However, most of our operations were search based, and it  
created no problem, there might be data mismatch if indexing operations  
remain active during this activity, I am not sure.

Please note that the second solution posted above is only a trial workout,  
worked in my case, and not a general solution.

The link at location  
[How to upgrade a running Elasticsearch older instance to a newer version? - Stack Overflow](http://stackoverflow.com/questions/9497223/how-to-upgrade-a-running-elasticsearch-older-instance-to-a-newer-version) was  
helpful.

On Monday, May 28, 2012 10:42:38 AM UTC+5:30, Sumit Gupta wrote:

> hi all,
> 
> Essentially I cannot find documents or resources that explains the  
> procedure  
> of upgrading a running Elastic search instance into the current version.
> 
> Please help me out in a few scenarios:-
> 
> 1 If I am running an Elastic search instance in a single server, how do I  
> upgrade the instance and not lose data?
> 
> 2 If I am running multiple Elasticsearch instances in a number of servers,  
> how do I keep my operations running, while I upgrade my Elasticsearch  
> instances without losing data?
> 
> if there are proper procedures or explanations on this it will greatly  
> help  
> my understanding and work. Thanks!
> 
> Regards,  
> Sumit Gupta
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/how-to-migrate-old-elastic-search-index-to-new-version-of-elastic-search-tp4018412.html](http://elasticsearch-users.115913.n3.nabble.com/how-to-migrate-old-elastic-search-index-to-new-version-of-elastic-search-tp4018412.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![Sumit\_Guptaa](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@Sumit\_Guptaa](https://discuss.elastic.co/u/Sumit_Guptaa)\
**Post date:** [May 28, 2012, 9:02am UTC](https://discuss.elastic.co/t/how-to-migrate-old-elastic-search-index-to-new-version-of-elastic-search/7877/3 "2012-05-28T09:02:08Z")

</div>

hi sujoysett

can you tell me what is the means of stop all nodes and how we can stop all nodes,and i want to ask one more things if we migrate our data from Elastic Search 0.18.7 to elastic search 0.19.0 then the data that is store in elastic search 0.18.7 is store or not?

thanx

Regards,  
Sumit Gupta

---

<div class="post-metadata">

**Author:** ![pulkitsinghal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pulkitsinghal/32/802_2.png) [@pulkitsinghal](https://discuss.elastic.co/u/pulkitsinghal)\
**Post date:** [May 28, 2012, 12:53pm UTC](https://discuss.elastic.co/t/how-to-migrate-old-elastic-search-index-to-new-version-of-elastic-search/7877/4 "2012-05-28T12:53:56Z")

</div>

I'll try to bridge the gap: nodes means servers

On Monday, May 28, 2012 4:02:08 AM UTC-5, Sumit Gupta wrote:

> hi sujoysett
> 
> can you tell me what is the means of stop all nodes and how we can stop  
> all  
> nodes,and i want to ask one more things if we migrate our data from  
> Elastic  
> Search 0.18.7 to Elasticsearch 0.19.0 then the data that is store in  
> Elasticsearch 0.18.7 is store or not?
> 
> thanx
> 
> Regards,  
> Sumit Gupta
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/how-to-migrate-old-elastic-search-index-to-new-version-of-elastic-search-tp4018412p4018426.html](http://elasticsearch-users.115913.n3.nabble.com/how-to-migrate-old-elastic-search-index-to-new-version-of-elastic-search-tp4018412p4018426.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![sujoysett](https://avatars.discourse-cdn.com/v4/letter/s/2acd7d/32.png) [@sujoysett](https://discuss.elastic.co/u/sujoysett)\
**Post date:** [May 28, 2012, 4:07pm UTC](https://discuss.elastic.co/t/how-to-migrate-old-elastic-search-index-to-new-version-of-elastic-search/7877/5 "2012-05-28T16:07:04Z")

</div>

Yes, by nodes I meant running instances of elasticsearch.  
And for the second question, yes, that is what the term migration means.  
Keeping your existing data as it is, but using the same on a new  
elasticsearch version.

Sujoy.

On Monday, May 28, 2012 6:23:56 PM UTC+5:30, pulkitsinghal wrote:

> I'll try to bridge the gap: nodes means servers
> 
> On Monday, May 28, 2012 4:02:08 AM UTC-5, Sumit Gupta wrote:
> 
> > hi sujoysett
> > 
> > can you tell me what is the means of stop all nodes and how we can stop  
> > all  
> > nodes,and i want to ask one more things if we migrate our data from  
> > Elastic  
> > Search 0.18.7 to Elasticsearch 0.19.0 then the data that is store in  
> > Elasticsearch 0.18.7 is store or not?
> > 
> > thanx
> > 
> > Regards,  
> > Sumit Gupta
> > 
> > --  
> > View this message in context:  
> > [http://elasticsearch-users.115913.n3.nabble.com/how-to-migrate-old-elastic-search-index-to-new-version-of-elastic-search-tp4018412p4018426.html](http://elasticsearch-users.115913.n3.nabble.com/how-to-migrate-old-elastic-search-index-to-new-version-of-elastic-search-tp4018412p4018426.html)  
> > Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![Sumit\_Guptaa](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@Sumit\_Guptaa](https://discuss.elastic.co/u/Sumit_Guptaa)\
**Post date:** [May 29, 2012, 10:59am UTC](https://discuss.elastic.co/t/how-to-migrate-old-elastic-search-index-to-new-version-of-elastic-search/7877/6 "2012-05-29T10:59:47Z")

</div>

thanx sujoysett

---

<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:26am UTC](https://discuss.elastic.co/t/how-to-migrate-old-elastic-search-index-to-new-version-of-elastic-search/7877/7 "2017-07-06T03:26:40Z")

</div>


