# Newly created index template does not apply on old indices?

**URL:** <https://discuss.elastic.co/t/newly-created-index-template-does-not-apply-on-old-indices/226583>\
**Category:** Elasticsearch\
**Created:** [April 5, 2020, 6:16pm UTC](https://discuss.elastic.co/t/newly-created-index-template-does-not-apply-on-old-indices/226583 "2020-04-05T18:16:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ghost\_recon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ghost_recon/32/59919_2.png) [@ghost\_recon](https://discuss.elastic.co/u/ghost_recon)\
**Post date:** [April 5, 2020, 6:16pm UTC](https://discuss.elastic.co/t/newly-created-index-template-does-not-apply-on-old-indices/226583/1 "2020-04-05T18:16:07Z")

</div>

I newly created an index templates that has the following index-pattern `log-*`,  
And i already have an old index under the name `log-server` which has a `timestamp` field that contains a different format than the default formats in elasticsearch ,which is `yyyy-MM-dd HH:mm:ss,SSS` , so i have put this format in the index template under mappings\>properties\>timestamp\>format .  
But whenever i try to send a record with that format it keeps saying

> failed to parse field [timestamp] of type [date] in document with id '54'. Preview of field's value: '2020-03-18 11:54:23,001'

So i tried to view the properties of the index by a get request to the indice ,it does not display the format unlike my newly created indices :

```
    "properties": {
        "@version": {
            "type": "keyword"
        },
        "log": {
            "type": "text",
            "norms": false,
            "fields": {
                "keyword": {
                    "type": "keyword",
                    "ignore_above": 256
                }
            }
        },
        "timestamp": {
            "type": "date"
        }
    }
},

```

any ideas ?  
Thank you.

---

<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:** [April 5, 2020, 6:32pm UTC](https://discuss.elastic.co/t/newly-created-index-template-does-not-apply-on-old-indices/226583/2 "2020-04-05T18:32:55Z")

</div>

Index templates are applied at index creation so will not apply to already existing indices.

---

<div class="post-metadata">

**Author:** ![ghost\_recon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ghost_recon/32/59919_2.png) [@ghost\_recon](https://discuss.elastic.co/u/ghost_recon)\
**Post date:** [April 5, 2020, 7:01pm UTC](https://discuss.elastic.co/t/newly-created-index-template-does-not-apply-on-old-indices/226583/3 "2020-04-05T19:01:29Z")

</div>

Thank you ,  
I just wanted to validate my assumption ,so sorry if it was a plain question.  
So does that mean that i have to delete my index and create a new one and if yes, how can i backup my data inside that index and re-emit them to the new one ?

---

<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:** [May 3, 2020, 7:01pm UTC](https://discuss.elastic.co/t/newly-created-index-template-does-not-apply-on-old-indices/226583/4 "2020-05-03T19:01:34Z")

</div>

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