I need to automate the snapshot and restore from one cluster to a backup cluster , but when I try to restore the snapshot it complains about the indices already exist. Then I either need to delete those indices or close those to be freshly restored. Is there any --force kind of option to overwrite everything from live cluster to backup cluster ?
There is re-indxeing option but that is slow as compared to snapshot and restore.
You can define
rename_pattern
andrename_replacement
as documentation suggests. To make it fully automated you could add time/date:And then use aliases to make this "backup" index look like a "normal" one:
Of course this means that you would have to write some automation scripts that generate that time/date and check the snapshot restore progress.
Hope that helps!