# Snapshot & Restore failing while restoring indices from ES 1.6.1 to ES 2.1.2

**URL:** https://discuss.elastic.co/t/snapshot-restore-failing-while-restoring-indices-from-es-1-6-1-to-es-2-1-2/49197
**Category:** Elasticsearch
**Created:** [May 4, 2016, 3:38pm UTC](https://discuss.elastic.co/t/snapshot-restore-failing-while-restoring-indices-from-es-1-6-1-to-es-2-1-2/49197 "2016-05-04T15:38:09Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![ayushsangani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ayushsangani/32/9612_2.png) [@ayushsangani](https://discuss.elastic.co/u/ayushsangani)
#### Post date: [May 4, 2016, 3:38pm UTC](https://discuss.elastic.co/t/snapshot-restore-failing-while-restoring-indices-from-es-1-6-1-to-es-2-1-2/49197/1 "2016-05-04T15:38:09Z")

</div>

Hey all,

I'm upgrading our ES cluster from 1.6.1 to 2.1.2, we have spun up new cluster with ES 2.1.2  
I have reindexed documents on ES 1.6.1 so that it passes all the checks on ES migration plugin. Now when I create a snapshot on ES `1.6.1` and try to restore it on `2.1.2` it throws an error

`{"error":{"root_cause":[{"type":"snapshot_restore_exception","reason":"[stage-05-2016:05-03_1215] cannot restore index [stage-index-1] because it cannot be upgraded"}],"type":"snapshot_restore_exception","reason":"[stage-05-2016:05-03_1215] cannot restore index [stage-index-1] because it cannot be upgraded","caused_by":{"type":"illegal_state_exception","reason":"unable to upgrade the mappings for the index [stage-index-1], reason: [Mapper for [_id] conflicts with existing mapping in other types:\n[mapper [_id] has different [index] values]]","caused_by":{"type":"illegal_argument_exception","reason":"Mapper for [_id] conflicts with existing mapping in other types:\n[mapper [_id] has different [index] values]"}}},"status":500}`

I believe this is because of `.percolator` type document which indexes `_id` by default in ES `1.6.1` even though if you don't specify explicitly in the mapping. I don't know if this has anything to do with the `.percolator` type documents.

Note: Snapshot and Restore works perfectly fine if I remove `.percolator` type mapping.

Any help would be really appreciated!

Let me know if any other information is required.

---

<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: [May 4, 2016, 4:23pm UTC](https://discuss.elastic.co/t/snapshot-restore-failing-while-restoring-indices-from-es-1-6-1-to-es-2-1-2/49197/2 "2016-05-04T16:23:01Z")

</div>

Sounds like the migration plugin should have catch that.

Could you open an issue on [Github elasticsearch-migration repo](https://github.com/elastic/elasticsearch-migration) with the mappings for your index?

Thanks!

---

<div class="post-metadata">

### Author: ![ayushsangani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ayushsangani/32/9612_2.png) [@ayushsangani](https://discuss.elastic.co/u/ayushsangani)
#### Post date: [May 4, 2016, 4:33pm UTC](https://discuss.elastic.co/t/snapshot-restore-failing-while-restoring-indices-from-es-1-6-1-to-es-2-1-2/49197/3 "2016-05-04T16:33:11Z")

</div>

Thanks for the reply @dadoonet  
I have filed an issue: [https://github.com/elastic/elasticsearch-migration/issues/56](https://github.com/elastic/elasticsearch-migration/issues/56)  
But it still doesn't seem to solve the problem, even though I create a mapping for `.percolator` type without `_id` field on ES 1.6.1; elasticsearch creates one.  
For example:  
My `.percolator` mapping

```auto
{ 
    ".percolator" : {
    "_routing" : {
      "required" : true
    },
    "_timestamp" : {
      "enabled" : true
    },
	"properties" : {
			"percolator_id" : { "type" : "string", "index" : "not_analyzed", "include_in_all" : false },
			"oid" : { "type" : "integer" },
			"user_id" : { "type" : "integer" },

			"query" : { "type" : "object", "enabled" : false }
		}
	}
}

```

ES 1.6.1 creates a mapping with:

```auto
{
  "stage-index-1": {
    "mappings": {
      ".percolator": {
        "_id": {
          "index": "not_analyzed"
        },
        "_routing": {
          "required": true
        },
        "_timestamp": {
          "enabled": true
        },
        "properties": {
          "oid": {
            "type": "integer",
            "doc_values": true
          },
          "percolator_id": {
            "type": "string",
            "index": "not_analyzed",
            "include_in_all": false
          },
          "query": {
            "type": "object",
            "enabled": false
          },
          "user_id": {
            "type": "integer"
          }
        }
      }
    }
  }
}

```

Note the `_id` being created in the mapping.  
So my guess is because `_id` is created by default for `.percolator` documents in earlier versions it is preventing me to restore snapshot to ES 2.1.2 version.

Please let me know if there is any workaround.

---

<div class="post-metadata">

### Author: ![haizhou](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/haizhou/32/9609_2.png) [@haizhou](https://discuss.elastic.co/u/haizhou)
#### Post date: [May 5, 2016, 2:37pm UTC](https://discuss.elastic.co/t/snapshot-restore-failing-while-restoring-indices-from-es-1-6-1-to-es-2-1-2/49197/4 "2016-05-05T14:37:30Z")

</div>

+1  
I was able to reproduce the same behavior around `_id` getting automatically created in `.percolator` type, which blocks us from migrating up.

---

<div class="post-metadata">

### Author: ![ayushsangani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ayushsangani/32/9612_2.png) [@ayushsangani](https://discuss.elastic.co/u/ayushsangani)
#### Post date: [May 9, 2016, 3:43pm UTC](https://discuss.elastic.co/t/snapshot-restore-failing-while-restoring-indices-from-es-1-6-1-to-es-2-1-2/49197/5 "2016-05-09T15:43:20Z")

</div>

@dadoonet @warkolm any input on this issue would be really helpful!

---

<div class="post-metadata">

### Author: ![ayushsangani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ayushsangani/32/9612_2.png) [@ayushsangani](https://discuss.elastic.co/u/ayushsangani)
#### Post date: [May 24, 2016, 9:32pm UTC](https://discuss.elastic.co/t/snapshot-restore-failing-while-restoring-indices-from-es-1-6-1-to-es-2-1-2/49197/6 "2016-05-24T21:32:35Z")

</div>

Thanks for help.  
We have fixed this by doing Snapshot & Restore without `.percolator` documents and wrote a script to manually migrate those documents so that we can at-least go ahead and upgrade elasticsearch.

---

<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:49pm UTC](https://discuss.elastic.co/t/snapshot-restore-failing-while-restoring-indices-from-es-1-6-1-to-es-2-1-2/49197/7 "2017-07-05T22:49:20Z")

</div>


