Restoring ISM from a snapshot
Introduced 3.10
Index State Management (ISM) stores policies and the policy progress of each managed index in the .opendistro-ism-config system index. If you restore .opendistro-ism-config from a snapshot, such as when migrating to another cluster, each managed index resumes its policy from the state recorded in the snapshot. For managed indexes to resume their policies, you must restore them before you restore .opendistro-ism-config.
Restoration order
ISM can match an index to its saved progress only if the index already exists when .opendistro-ism-config is restored. ISM matches saved progress to an index using the index name and creation date. If an index was deleted and then recreated under the same name, it has a new creation date. ISM doesn’t match the recreated index to its saved progress, so the index starts its policy from the beginning.
Using the Restore Snapshot API, restore indexes in the following order:
-
Restore the managed indexes and wait for the restore operation to finish:
POST /_snapshot/my-repository/snapshot-1/_restore?wait_for_completion=true { "indices": "my-index-*", "include_global_state": false } -
Restore
.opendistro-ism-configin a separate request:POST /_snapshot/my-repository/snapshot-1/_restore { "indices": ".opendistro-ism-config", "include_global_state": false }
If you restore .opendistro-ism-config first or in the same request as the managed indexes, ISM can’t match the managed indexes to their saved progress. Indexes that were attached to a policy by an ISM template restart the policy from the beginning. ISM stops managing indexes that were attached using the Add Policy API.
Permissions
If the Security plugin protects system indexes in your cluster, restoring .opendistro-ism-config requires permission to restore system indexes. A user mapped to a role in plugins.security.restapi.roles_enabled can restore a system index if the index is listed in the plugins.security.system_indices.restore.indices setting. .opendistro-ism-config is listed by default. You can also restore system indexes as a super admin or using system index permissions. For more information, see Who can restore system indexes.