None of these worked.
root@d8812acff23c:~# curl -X POST "localhost:9200/_snapshot/azure_repo/my_snapshot_2/_restore" -H 'Content-Type: application/json' -d'
> {
> "indices": "*,-.*",
> "include_global_state": false
> }
> '
{"error":{"root_cause":[{"type":"snapshot_restore_exception","reason":"[azure_repo:my_snapshot_2/xmdavGDARfGZFm-_kp8x-g] cannot restore index [.ds-ilm-history-5-2022.10.13-000001] because an open index with same name already exists in the cluster. Either close or delete the existing index or restore the index under a different name by providing a rename pattern and replacement name"}],"type":"snapshot_restore_exception","reason":"[azure_repo:my_snapshot_2/xmdavGDARfGZFm-_kp8x-g] cannot restore index [.ds-ilm-history-5-2022.10.13-000001] because an open index with same name already exists in the cluster. Either close or delete the existing index or restore the index under a different name by providing a rename dices": "*,-.*",^C"},"status":500}root@d8812acff23c:~# "include_global_state": false
root@d8812acff23c:~# ^C
root@d8812acff23c:~# ^C
root@d8812acff23c:~# ^C
root@d8812acff23c:~# curl -X POST "localhost:9200/_snapshot/azure_repo/my_snapshot_2/_restore" -H 'Content-Type: application/json' -d'
> {
> "indices": "*,-.*",
> "include_global_state": false,
> "feature_states": ["none"]
> }
> '
{"error":{"root_cause":[{"type":"snapshot_restore_exception","reason":"[azure_repo:my_snapshot_2/xmdavGDARfGZFm-_kp8x-g] cannot restore index [.ds-ilm-history-5-2022.10.13-000001] because an open index with same name already exists in the cluster. Either close or delete the existing index or restore the index under a different name by providing a rename pattern and replacement name"}],"type":"snapshot_restore_exception","reason":"[azure_repo:my_snapshot_2/xmdavGDARfGZFm-_kp8x-g] cannot restore index [.ds-ilm-history-5-2022.10.13-000001] because an open index with same name already exists in the cluster. Either close or delete the existing index or restore the index under a different name by providing a rename pattern and replacement name"},"status":500}root@d8812acff23c:~#
The only thing that works for me is taking a snapshot with just "indices": "*,-.*"
and restoring with the same "indices": "*,-.*"
. This helps restore only non internal indices.
root@d8812acff23c:~# curl -X PUT "localhost:9200/_snapshot/azure_repo/my_snapshot_5?wait_for_completion=true&pretty" -H 'Content-Type: application/json' -d'
> {
> "indices": "*,-.*"
> }
> '
{
"snapshot" : {
"snapshot" : "my_snapshot_5",
"uuid" : "Us1U3C9nQOqMKGLcVWZa1A",
"repository" : "azure_repo",
"version_id" : 7170099,
"version" : "7.17.0",
"indices" : [
"my-index-000001",
".geoip_databases"
],
"data_streams" : [ ],
"include_global_state" : true,
"state" : "SUCCESS",
"start_time" : "2022-10-27T08:46:01.009Z",
"start_time_in_millis" : 1666860361009,
"end_time" : "2022-10-27T08:46:04.012Z",
"end_time_in_millis" : 1666860364012,
"duration_in_millis" : 3003,
"failures" : [ ],
"shards" : {
"total" : 2,
"failed" : 0,
"successful" : 2
},
"feature_states" : [
{
"feature_name" : "geoip",
"indices" : [
".geoip_databases"
]
}
]
}
}
root@d8812acff23c:~#
root@d8812acff23c:~# curl localhost:9200/_cat/indices?v
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
green open .geoip_databases 0jQEhaCfQOm2Dt6jhUPMlg 1 1 41 41 78.2mb 39.1mb
green open my-index-000001 1UQIYamxQwiA2lOkvZA3bg 1 1 1 0 5.1kb 4.9kb
root@d8812acff23c:~#
root@d8812acff23c:~# curl -X DELETE localhost:9200/my-index-000001
{"acknowledged":true}root@d8812acff23c:~#
root@d8812acff23c:~#
root@d8812acff23c:~# curl -X POST "localhost:9200/_snapshot/azure_repo/my_snapshot_5/_restore" -H 'Content-Type: application/json' -d'
> {
> "indices": "*,-.*"
> }'
{"accepted":true}root@d8812acff23c:~#
root@d8812acff23c:~#
root@d8812acff23c:~#
root@d8812acff23c:~# curl localhost:9200/_cat/indices?v
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
green open .geoip_databases 0jQEhaCfQOm2Dt6jhUPMlg 1 1 41 41 78.2mb 39.1mb
green open my-index-000001 jL16ryOcSO2KFdt_AhrJvA 1 1 1 0 9.8kb 4.9kb
root@d8812acff23c:~#