How does one restore just missing backups from a snapshot

I am recovering from a disaster with my cluster and I have a lost about 150 out of 500 indexes. What I would like to do is restore just the missing ones from kibana but not the ones that are OK.

Is there a way to do this without enumerating all the missing ones? I.e. tell it don't restore index if it already exists?

I can do this from the API but I would rather not have to write yet another program to build the list of missing indices and then restore them.

There's no facility in Elasticsearch to do this, nor am I aware of such a feature in Kibana. Do you mean that the indices are completely missing (i.e. this is a new cluster, or the unhealthy indices were deleted) or that they're present but in red health? I think it'd be dangerous to have a button in Kibana to restore just the unhealthy indices since we've no way to know whether it's a transient state or not and we wouldn't want to do it for transiently-unhealthy ones. However you can get a list of the unhealthy indices like this:

curl -s 'http://localhost:9200/_cat/indices?format=json' | jq 'map(select(.health == "red") | .index)'

If the indices are completely missing then there's also no way to do it today without comparing the lists of indices by hand, but it ought to be possible to add this feature.

yes the indexes were deleted to get the cluster functional again.

Thanks, you have confirmed what I was pretty sure was the case and I am currently adding code to my es-util ruby progam to get a list of indexes matching a pattern and then another similar list of indexes from the snapshots(s) and then iterate over the one from the snapshot and doing a restore if the there is no matching index in the cluster.

I was going to wait for a response but decided to make a start anyway.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.