# After rolling over, new index doesn't have dynamic template mappings from old one

**URL:** https://discuss.elastic.co/t/after-rolling-over-new-index-doesnt-have-dynamic-template-mappings-from-old-one/205716
**Category:** Elasticsearch
**Created:** [October 29, 2019, 4:04pm UTC](https://discuss.elastic.co/t/after-rolling-over-new-index-doesnt-have-dynamic-template-mappings-from-old-one/205716 "2019-10-29T16:04:28Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![sensei-wu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sensei-wu/32/46499_2.png) [@sensei-wu](https://discuss.elastic.co/u/sensei-wu)
#### Post date: [October 29, 2019, 4:04pm UTC](https://discuss.elastic.co/t/after-rolling-over-new-index-doesnt-have-dynamic-template-mappings-from-old-one/205716/1 "2019-10-29T16:04:28Z")

</div>

In elasticsearch 6.4, I have an alias `/foo` which had an index of the format `/foo-000001`. This index was created with a mapping which also included dynamic template. When data grew, I rolled over using

```
POST /foo/_rollover
{
  "conditions": {
    "max_age": "30d",
    "max_size": "500gb"
  }
}

```

Rollover worked as expected and resulted in the creation of `foo-000002`, but to my surprise and disappointment I lost the mappings created via dynamic templates. Any idea where it went wrong or what I may have missed during rollover?

---

<div class="post-metadata">

### Author: ![linkerc](https://avatars.discourse-cdn.com/v4/letter/l/13edae/32.png) [@linkerc](https://discuss.elastic.co/u/linkerc)
#### Post date: [October 30, 2019, 8:12pm UTC](https://discuss.elastic.co/t/after-rolling-over-new-index-doesnt-have-dynamic-template-mappings-from-old-one/205716/2 "2019-10-30T20:12:53Z")

</div>

You need to include the mapping and setting in your rollover call.  
It's not automatic unless you use template.

---

<div class="post-metadata">

### Author: ![sensei-wu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sensei-wu/32/46499_2.png) [@sensei-wu](https://discuss.elastic.co/u/sensei-wu)
#### Post date: [November 20, 2019, 12:30pm UTC](https://discuss.elastic.co/t/after-rolling-over-new-index-doesnt-have-dynamic-template-mappings-from-old-one/205716/3 "2019-11-20T12:30:01Z")

</div>

thanks, it makes sense now

---

<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: [December 18, 2019, 12:30pm UTC](https://discuss.elastic.co/t/after-rolling-over-new-index-doesnt-have-dynamic-template-mappings-from-old-one/205716/4 "2019-12-18T12:30:14Z")

</div>

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