Restore data for only a specific index within a data stream

Regarding the snapshot and restore functionality for data streams, I can only snapshot all the data within a data stream at once, and when restoring, I can only restore all the data at once as well.

Is it possible to restore data for only a specific index within a data stream?

Yes, in the restore UI in Kibana just select Index Patterns and type the name of the backing indices of the data stream.

That's how I always did it.

You will need to add the backing index to the data stream manually later.

POST _data_stream/_modify
{
  "actions": [
    {
      "add_backing_index": {
        "data_stream": "data-stream",
        "index": ".backing-indice"
      }
    }
  ]
}

Also, in the Modify index Settings option you will probably need to add this:

{
  "index.lifecycle.name": null,
  "index.final_pipeline": null,
  "index.default_pipeline": null,
  "index.number_of_replicas": "0",
  "index.hidden": false
}
1 Like

Awesome

hi @leandrojmp

By the way, is there any plan to optimize the recovery of specific index snapshots within a data stream? The storage on Elasticsearch nodes cannot be configured with standard redundancy for restoring the entire data stream snapshot, and recovering specific indices requires using the data stream API via Dev Tools, which is not very user-friendly.

No idea, I do not work at Elastic.

Elastic also does not provide any information about roadmaps and future features, you should open an Enhancement request if you have a support contract or a feature request in Github.

But I agree that the UI/UX related to restorign snapshots could be improved.

Sometimes the user may not even know that a backing index of a data stream is hidden per default, and restoring individual indices without changing index.hidden to false will make those indices to not appear on the restore page, so this can be confusing for the user.

Couldn't agree more.
It will only appear on the restore status page after using the stream's modify.

hi @jughosta, Could this be made a bit more user-friendly? At the very least, it could inform me of a status like "waiting to be added a data stream."