# Changing mapping during the restore

**URL:** https://discuss.elastic.co/t/changing-mapping-during-the-restore/200022
**Category:** Elasticsearch
**Created:** [September 18, 2019, 2:03pm UTC](https://discuss.elastic.co/t/changing-mapping-during-the-restore/200022 "2019-09-18T14:03:11Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![skouame](https://avatars.discourse-cdn.com/v4/letter/s/7ba0ec/32.png) [@skouame](https://discuss.elastic.co/u/skouame)
#### Post date: [September 18, 2019, 2:03pm UTC](https://discuss.elastic.co/t/changing-mapping-during-the-restore/200022/1 "2019-09-18T14:03:12Z")

</div>

Hello i would like to retore the my index **asset\_item\_index\_1** to another another index **asset\_pp\_item\_index\_1**

index save with mapping

{  
" **asset\_item\_index\_1**": {  
"aliases": {  
"asset\_pp\_item": {  
"is\_write\_index": true  
}  
},  
"mappings": {  
" **asset\_item**": {  
"dynamic": "false",  
"properties": {  
"companyId": {  
"type": "long"  
},  
"id": {  
"type": "long"  
},  
"interventionLink": {  
"type": "text",  
"fields": {  
"keyword": {  
"type": "keyword",  
"ignore\_above": 256  
}  
}  
},  
"inventoryNumber": {  
"type": "text",  
"fields": {  
"keyword": {  
"type": "keyword",  
"ignore\_above": 256  
}  
},  
"analyzer": "lower\_analyzer",  
"fielddata": true  
},  
"quantity": {  
"type": "long"  
},  
"reloadFluidDate": {  
"type": "date"  
},  
"userId": {  
"type": "long"  
},  
"withdrawFluidDate": {  
"type": "date"  
}  
}  
}  
},  
"settings": {  
"index": {  
"number\_of\_shards": "5",  
"provided\_name": " **asset\_item\_index\_1**",  
"creation\_date": "1564995341727",  
"analysis": {  
"analyzer": {  
"lower\_analyzer": {  
"filter": [  
"lowercase"  
],  
"tokenizer": "keyword"  
}  
}  
},  
"number\_of\_replicas": "1",  
"uuid": "7E7Cv9G5TSqlp7Z\_sAZmBw",  
"version": {  
"created": "6040299"  
}  
}  
}  
}  
}

index retore with mapping

{  
" **asset\_pp\_item\_index\_1**": {  
"aliases": {  
"asset\_pp\_item": {  
"is\_write\_index": true  
}  
},  
"mappings": {  
"_ **asset\_item** _": {  
"dynamic": "false",  
"properties": {  
"companyId": {  
"type": "long"  
},  
"id": {  
"type": "long"  
},  
"interventionLink": {  
"type": "text",  
"fields": {  
"keyword": {  
"type": "keyword",  
"ignore\_above": 256  
}  
}  
},  
"inventoryNumber": {  
"type": "text",  
"fields": {  
"keyword": {  
"type": "keyword",  
"ignore\_above": 256  
}  
},  
"analyzer": "lower\_analyzer",  
"fielddata": true  
},  
"quantity": {  
"type": "long"  
},  
"reloadFluidDate": {  
"type": "date"  
},  
"userId": {  
"type": "long"  
},  
"withdrawFluidDate": {  
"type": "date"  
}  
}  
}  
},  
"settings": {  
"index": {  
"number\_of\_shards": "5",  
"provided\_name": "_ **asset\_item\_index\_1** _",  
"creation\_date": "1564995341727",  
"analysis": {  
"analyzer": {  
"lower\_analyzer": {  
"filter": [  
"lowercase"  
],  
"tokenizer": "keyword"  
}  
}  
},  
"number\_of\_replicas": "1",  
"uuid": "7E7Cv9G5TSqlp7Z\_sAZmBw",  
"version": {  
"created": "6040299"  
}  
}  
}  
}  
}

but the type _ **asset\_item** _ were never changes, i don't know why ?

below my query restore  
POST /\_snapshot/my\_backup/snapshot\_1/\_restore  
{  
"indices": "asset\_item\_index\_1",  
"rename\_pattern": "asset\_item\_index\_1",  
"include\_aliases": true,  
"rename\_replacement": "asset\_pp\_item\_index\_1"  
}  
have you some idea or what do can i do it ?

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [September 18, 2019, 4:28pm UTC](https://discuss.elastic.co/t/changing-mapping-during-the-restore/200022/2 "2019-09-18T16:28:42Z")

</div>

You can not restore to an index with a different mapping as the mapping is part of the snapshot. Changing mappings require reindexing.

---

<div class="post-metadata">

### Author: ![skouame](https://avatars.discourse-cdn.com/v4/letter/s/7ba0ec/32.png) [@skouame](https://discuss.elastic.co/u/skouame)
#### Post date: [September 19, 2019, 7:33am UTC](https://discuss.elastic.co/t/changing-mapping-during-the-restore/200022/3 "2019-09-19T07:33:12Z")

</div>

Thank you Christian, it is almost the same mapping except "provided\_name": " _ **asset\_item\_index\_1** _ " and type " _ **asset\_item\_index\_1** _ " that i want to change respectively "provided\_name": " _ **asset\_pp\_item\_index\_1** _ " and type "provided\_name": " _ **asset\_pp\_tem\_index\_1** _ "

So the great solution is to reindex after restore

---

<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: [October 17, 2019, 7:33am UTC](https://discuss.elastic.co/t/changing-mapping-during-the-restore/200022/4 "2019-10-17T07:33:20Z")

</div>

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