# Export indice from elasticsearch 1.6 to 2.1.1

**URL:** https://discuss.elastic.co/t/export-indice-from-elasticsearch-1-6-to-2-1-1/41787
**Category:** Elasticsearch
**Created:** [February 15, 2016, 1:13pm UTC](https://discuss.elastic.co/t/export-indice-from-elasticsearch-1-6-to-2-1-1/41787 "2016-02-15T13:13:48Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![maxg](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@maxg](https://discuss.elastic.co/u/maxg)
#### Post date: [February 15, 2016, 1:13pm UTC](https://discuss.elastic.co/t/export-indice-from-elasticsearch-1-6-to-2-1-1/41787/1 "2016-02-15T13:13:48Z")

</div>

Hi,

I'm trying to snapshot an elasticsearch 1.6 to restore the indice on a brand new elasticsearch 2.1.1

The snapshot on the elasticsearch 1.6 seems ok, I can see that with a Get

> {  
> "snapshots" : [ {  
> "snapshot" : "kibana\_20160212",  
> "version\_id" : 1060099,  
> "version" : "1.6.0",  
> "indices" : [".kibana"],  
> "state" : "SUCCESS",  
> "start\_time" : "2016-02-12T14:56:54.308Z",  
> "start\_time\_in\_millis" : 1455289014308,  
> "end\_time" : "2016-02-12T14:56:54.694Z",  
> "end\_time\_in\_millis" : 1455289014694,  
> "duration\_in\_millis" : 386,  
> "failures" : ,  
> "shards" : {  
> "total" : 1,  
> "failed" : 0,  
> "successful" : 1  
> }  
> } ]  
> }

And when I try to make the restore on the new elasticsearch 2.1.1 I have this message.

> {"error":{"root\_cause":[{"type":"illegal\_state\_exception","reason":"No state match for [SUCCESS]"}],"type":"illegal\_state\_exception","reason":"No state match for [SUCCESS]"},"status":500}

Is it a compatibility problem ? Can I "convert" data, or other thing ?

Thanks for your help

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [February 15, 2016, 3:59pm UTC](https://discuss.elastic.co/t/export-indice-from-elasticsearch-1-6-to-2-1-1/41787/2 "2016-02-15T15:59:21Z")

</div>

What is the restore command you are calling, can you replicate the entire thing?

---

<div class="post-metadata">

### Author: ![maxg](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@maxg](https://discuss.elastic.co/u/maxg)
#### Post date: [February 15, 2016, 4:22pm UTC](https://discuss.elastic.co/t/export-indice-from-elasticsearch-1-6-to-2-1-1/41787/3 "2016-02-15T16:22:58Z")

</div>

To restore I used

> curl -XPOST '[http://localhost:9200/\_snapshot/my\_backup/kibana\_20160212/\_restore](http://localhost:9200/_snapshot/my_backup/kibana_20160212/_restore)'

And in the /var/lib/elasticsearch/my\_backup/ I have transfered metada and data files  
metadata-kibana\_20160212  
snapshot-kibana\_20160212

It's not the same format of naming as in the new version of elasticsearch, but if I change I have an error.

And to make the snapshot on the old elasticsearch I have used

> curl -s -XPUT '[http://localhost:9200/\_snapshot/my\_backup/kibana\_20160212](http://localhost:9200/_snapshot/my_backup/kibana_20160212)'' -d '  
> {  
> "indices": ".kibana",  
> "ignore\_unavailable": "true",  
> "include\_global\_state": false  
> }'

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [February 15, 2016, 4:25pm UTC](https://discuss.elastic.co/t/export-indice-from-elasticsearch-1-6-to-2-1-1/41787/4 "2016-02-15T16:25:53Z")

</div>

> [@maxg](#):
>
> And in the /var/lib/elasticsearch/my\_backup/ I have transfered metada and data files

What do you mean by this, transferred from where?

---

<div class="post-metadata">

### Author: ![maxg](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@maxg](https://discuss.elastic.co/u/maxg)
#### Post date: [February 16, 2016, 3:29pm UTC](https://discuss.elastic.co/t/export-indice-from-elasticsearch-1-6-to-2-1-1/41787/5 "2016-02-16T15:29:11Z")

</div>

In fact the snapshot command on the old elasticsearch 1.6 make two files  
metadata-kibana\_20160212  
snapshot-kibana\_20160212

And I have transfered those two files on the new elasticsearch 2.1.1 into the /var/lib/elasticsearch/my\_backup/ to make the restore.

---

<div class="post-metadata">

### Author: ![maxg](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@maxg](https://discuss.elastic.co/u/maxg)
#### Post date: [February 18, 2016, 8:41am UTC](https://discuss.elastic.co/t/export-indice-from-elasticsearch-1-6-to-2-1-1/41787/6 "2016-02-18T08:41:48Z")

</div>

Any idea ?

Is it possible to migrate from 1.6 to 2.1.1 ? or what I try to do is not possible or too complicated ?

---

<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: [February 18, 2016, 2:30pm UTC](https://discuss.elastic.co/t/export-indice-from-elasticsearch-1-6-to-2-1-1/41787/7 "2016-02-18T14:30:18Z")

</div>

Ideally you should just mount the dit which contains all snapshot files on the new machine. Then run the restore.

That being said, are you 100% sure your data are compatible with elasticsearch 2.x?  
Did you first try the migration plugin?

How many nodes do you have BTW?

---

<div class="post-metadata">

### Author: ![maxg](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@maxg](https://discuss.elastic.co/u/maxg)
#### Post date: [February 23, 2016, 10:07am UTC](https://discuss.elastic.co/t/export-indice-from-elasticsearch-1-6-to-2-1-1/41787/8 "2016-02-23T10:07:44Z")

</div>

Ok thank you, I understand the best practice to use the snapshot.

Hum no I don't know if data from elasticsearch 1.6 are compatible with the 2.x.

I didn't test yet the migration plugin, is it that plugin [elasticsearch-migration](https://github.com/elastic/elasticsearch-migration) ?

I have 3 nodes on the "old" infra using elasticsearch 1.6 and 4 nodes on the new one.

Thanks again for your help and your time.

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [February 23, 2016, 6:30pm UTC](https://discuss.elastic.co/t/export-indice-from-elasticsearch-1-6-to-2-1-1/41787/9 "2016-02-23T18:30:33Z")

</div>

> [@maxg](#):
>
> I didn't test yet the migration plugin, is it that plugin elasticsearch-migration ?

Yes, you should _definitely_ run this before upgrading.

---

<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, 11:14pm UTC](https://discuss.elastic.co/t/export-indice-from-elasticsearch-1-6-to-2-1-1/41787/10 "2017-07-05T23:14:08Z")

</div>


