Saturday, 15 August 2026

Restore Given Index in Elastic Search to a Diffrent Index Name from a Snapshot

 In elastic (cloud or on self hosted in AKS) we can take snapshots of our indices. If we want to restore evrything we can do a full restore for a recovery. However, in a situation where we need to restore a single index into a diffrent name to prevent touching existing live index, but we need to recover some index documents previously was there in a given index (which are deleted as of now), we have the option of restoring a given index by a diffren t name.

Below is an example


Here the highligeted index was restored as "zchtemp-restored-index". Since we have used the latest snapshot it is 100% equal to the exsting index. But in a situation where you would use an older snapshot old status can be restored and inspected to extract required index documents.

In elastic dev tools we can run a command such as below to achive this.

//-----------------------------
// Restore specific index in diffrent name
POST /_snapshot/ch_backups/daily-snapshot-2026.08.12-tnhjpr_vtdilea5_nkqtha/_restore
{
  "indices": "cb4dc398-a68e-4166-9b45-72a38003bde3",
  "include_global_state": false,
  "rename_pattern": "cb4dc398-a68e-4166-9b45-72a38003bde3",
  "rename_replacement": "zchtemp-restored-index"
}
//-----------------------------

No comments:

Popular Posts