# Composable templates- how to convert Legacy?

**URL:** <https://discuss.elastic.co/t/composable-templates-how-to-convert-legacy/276934>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [June 24, 2021, 1:42pm UTC](https://discuss.elastic.co/t/composable-templates-how-to-convert-legacy/276934 "2021-06-24T13:42:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![P\_Larsen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/p_larsen/32/40097_2.png) [@P\_Larsen](https://discuss.elastic.co/u/P_Larsen)\
**Post date:** [June 24, 2021, 1:42pm UTC](https://discuss.elastic.co/t/composable-templates-how-to-convert-legacy/276934/1 "2021-06-24T13:42:34Z")

</div>

How do I convert this to the new composable templates without breaking my ILM config?

```auto
PUT _template/99999-test_deleteme_policy
{
"index_patterns": [
"99999-test_deleteme-*"
],
"settings": {
"index": {
"number_of_shards": 5,
"number_of_replicas": 1,
"lifecycle.name": "99999-test_deleteme_policy",
"lifecycle.rollover_alias": "99999-test_deleteme"
}
}
}

```

---

<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:** [June 24, 2021, 2:56pm UTC](https://discuss.elastic.co/t/composable-templates-how-to-convert-legacy/276934/2 "2021-06-24T14:56:20Z")

</div>

I believe that something like this should work:

```auto
PUT _index_template/99999-test_deleteme_policy
{
  "index_patterns": ["99999-test_deleteme-*"],
  "template": {
    "settings": {
      "number_of_shards": 5,
      "number_of_replicas": 1,
      "lifecycle.name": "99999-test_deleteme_policy",
      "lifecycle.rollover_alias": "99999-test_deleteme"
    }
  },
  "priority": 100
}

```

---

<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 22, 2021, 2:57pm UTC](https://discuss.elastic.co/t/composable-templates-how-to-convert-legacy/276934/3 "2021-07-22T14:57:06Z")

</div>

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