# Is it possible to restore a snapshot (s3) and change index mappings?

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-restore-a-snapshot-s3-and-change-index-mappings/56894>\
**Category:** Elasticsearch\
**Created:** [August 1, 2016, 1:28pm UTC](https://discuss.elastic.co/t/is-it-possible-to-restore-a-snapshot-s3-and-change-index-mappings/56894 "2016-08-01T13:28:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ndtreviv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ndtreviv/32/22494_2.png) [@ndtreviv](https://discuss.elastic.co/u/ndtreviv)\
**Post date:** [August 1, 2016, 1:28pm UTC](https://discuss.elastic.co/t/is-it-possible-to-restore-a-snapshot-s3-and-change-index-mappings/56894/1 "2016-08-01T13:28:48Z")

</div>

I'm currently trying to upgrade our systems to 2.x from 1.x.

Unfortunately our 1.x fields had dots ('.') in them. I've written a program that replaces the dots for a legal character.

My plan was then to snapshot the dotless data and restore to an es 2.x, but that doesn't work. Even though I've modified the data, the snapshot takes the index mappings with it:

```
{
  "error" : {
    "root_cause" : [ {
      "type" : "snapshot_restore_exception",
      "reason" : "[s3incremental:201608011118] cannot restore index [status] because it cannot be upgraded"
    } ],
    "type" : "snapshot_restore_exception",
    "reason" : "[s3incremental:201608011118] cannot restore index [status] because it cannot be upgraded",
    "caused_by" : {
      "type" : "illegal_state_exception",
      "reason" : "unable to upgrade the mappings for the index [status], reason: [Field name [error.cause] cannot contain '.']",
      "caused_by" : {
        "type" : "mapper_parsing_exception",
        "reason" : "Field name [error.cause] cannot contain '.'"
      }
    }
  },
  "status" : 500
}

```

Is there any way of doing a snapshot or restore either without the index mappings, or by somehow mutating the index mappings on the way in so that they don't reference the illegal field names?

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [August 1, 2016, 2:06pm UTC](https://discuss.elastic.co/t/is-it-possible-to-restore-a-snapshot-s3-and-change-index-mappings/56894/2 "2016-08-01T14:06:37Z")

</div>

No, sorry there isn't. 5.0 should support dots in field names again but you won't be able to restore 1.0 indicies into it because 5.0 isn't compatible with the metadata and on disk format.

At this point I think the only way around this is to copy from 1.x to 2.x (or 5.0, depending on your timetable and how quickly 5.0 become ready, which is still not known). That might mean resting into 1.x and then copying if you don't have the data restored anywhere.

For what it is worth 5.0 has reindex-from-remote already in the alphas. And that supports mutating the documents with a script.

---

<div class="post-metadata">

**Author:** ![ndtreviv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ndtreviv/32/22494_2.png) [@ndtreviv](https://discuss.elastic.co/u/ndtreviv)\
**Post date:** [August 1, 2016, 2:11pm UTC](https://discuss.elastic.co/t/is-it-possible-to-restore-a-snapshot-s3-and-change-index-mappings/56894/3 "2016-08-01T14:11:17Z")

</div>

Thanks!

I'm going to make moving the documents to a new index part of the data migration process. If I delete the old indexes afterwards, then I'm hoping the snapshots will then only have valid mappings in and will work. Fingers crossed!

---

<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:31pm UTC](https://discuss.elastic.co/t/is-it-possible-to-restore-a-snapshot-s3-and-change-index-mappings/56894/4 "2017-07-05T22:31:09Z")

</div>


