<titleabbrev>Migrate indices and ILM policies to data tiers routing</titleabbrev>
++++
Switches the indices and ILM policies from using custom node attributes and
<<shard-allocation-filtering, attribute-based allocation filters>> to using <<data-tiers, data tiers>>, and
optionally deletes one legacy index template.
Using node roles enables {ilm-init} to <<data-tier-migration, automatically move the indices>> between
data tiers.
Migrating away from custom node attributes routing can be manually performed
as indicated in the <<migrate-index-allocation-filters, Migrate index allocation
filters to node roles>> page.
This API provides an automated way of executing three out of the four manual steps listed
in the <<data-tier-migration, migration guide>>:
. <<stop-setting-custom-hot-attribute, Stop setting the custom hot attribute on new indices>>
. <<remove-custom-allocation-settings, Remove custom allocation settings from existing {ilm-init} policies>>
. <<set-tier-preference, Replace custom allocation settings from existing indices>> with the corresponding <<data-tier-shard-filtering,tier preference>>
[[ilm-migrate-to-data-tiers-request]]
==== {api-request-title}
`POST /_ilm/migrate_to_data_tiers`
The API accepts an optional body that allows you to specify:
- The legacy index template name to delete. Defaults to none.
- The name of the custom node attribute used for the indices and ILM policies allocation filtering.
Defaults to `data`.
[[ilm-migrate-to-data-tiers-prereqs]]
==== {api-prereq-title}
* {ilm-init} must be stopped before performing the migration. Use the <<ilm-stop-request, stop ILM API>>
to stop {ilm-init} and <<ilm-get-status-request, get status API>> to wait until the