# Is it possible to change Index-level data tier allocation after creation?

**URL:** https://discuss.elastic.co/t/is-it-possible-to-change-index-level-data-tier-allocation-after-creation/370186
**Category:** Elasticsearch
**Created:** [November 7, 2024, 10:45pm UTC](https://discuss.elastic.co/t/is-it-possible-to-change-index-level-data-tier-allocation-after-creation/370186 "2024-11-07T22:45:32Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![catmanjan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/catmanjan/32/77810_2.png) [@catmanjan](https://discuss.elastic.co/u/catmanjan)
#### Post date: [November 7, 2024, 10:45pm UTC](https://discuss.elastic.co/t/is-it-possible-to-change-index-level-data-tier-allocation-after-creation/370186/1 "2024-11-07T22:45:32Z")

</div>

Hello, the documentation isn't clear on this - is it possible to set the data tier allocation AFTER an index has been created? e.g. index.routing.allocation.include.\_tier\_preference

We are in a situation where a piece of software creates its own index but its defaulting to content, we'd like it to be warm instead but we are not sure whether that means we need to create the index ourselves or if we can do it after the fact...

---

<div class="post-metadata">

### Author: ![rugenl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rugenl/32/12887_2.png) [@rugenl](https://discuss.elastic.co/u/rugenl)
#### Post date: [November 8, 2024, 1:36am UTC](https://discuss.elastic.co/t/is-it-possible-to-change-index-level-data-tier-allocation-after-creation/370186/2 "2024-11-08T01:36:23Z")

</div>

I had a thought, may be a bad thought, but can you template the index to assign an ILM policy? Treat where it's allocated as hot, assign it to warm at rollover to move it to the desired nodes. How often does it create new indices?

If it has a template, can you add a component template to override the routing?

---

<div class="post-metadata">

### Author: ![catmanjan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/catmanjan/32/77810_2.png) [@catmanjan](https://discuss.elastic.co/u/catmanjan)
#### Post date: [November 8, 2024, 2:06am UTC](https://discuss.elastic.co/t/is-it-possible-to-change-index-level-data-tier-allocation-after-creation/370186/3 "2024-11-08T02:06:26Z")

</div>

Hello it just creates one index once ever, its a black box to me how it creates the template, I think its using a Cpp library to make REST calls directly against Elasticsearch to create the index...

---

<div class="post-metadata">

### Author: ![rugenl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rugenl/32/12887_2.png) [@rugenl](https://discuss.elastic.co/u/rugenl)
#### Post date: [November 8, 2024, 2:10am UTC](https://discuss.elastic.co/t/is-it-possible-to-change-index-level-data-tier-allocation-after-creation/370186/4 "2024-11-08T02:10:04Z")

</div>

You should be able to create a test index like it in dev tools, then try to change the routing. See what happens 🙂

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [November 8, 2024, 12:29pm UTC](https://discuss.elastic.co/t/is-it-possible-to-change-index-level-data-tier-allocation-after-creation/370186/5 "2024-11-08T12:29:22Z")

</div>

> [@catmanjan](#):
>
> We are in a situation where a piece of software creates its own index but its defaulting to content, we'd like it to be warm instead but we are not sure whether that means we need to create the index ourselves or if we can do it after the fact

If I'm not wrong when you do not specify the value for `index.routing.allocation.include._tier_preference` in an index template, it will go to `data_content` for normal index and `data_hot` for data streams.

If the application you are using does not create a template, you may create one just to change the tier preference.

It would be something like this:

```auto
{
    "index_patterns" : ["indexName"],
    "template": {
        "settings": {
            "index" : {
                "routing" : {
                    "allocation" : {
                        "include" : {
                            "_tier_preference" : "data_warm"
                        }
                    }
                }
            }
        }
    },    
    "priority": 100,
    "version": 1
}

```

You can also move an index to a different tier using the following request:

```auto
PUT /indexName/_settings
{
    "index": {
      "routing": {
        "allocation": {
          "include": {
            "_tier_preference": "data_warm"
          }
        }
      }
    }
}

```
