Restoring to a new index

Hello,

I am running the following command to restore snapshot into a new index

I am grabbing quai_report_20170628 from the snapshot, and trying to restore to quai_report_20170628_2

curl -XPOST http://localhost:9200/_snapshot/WC1_BETAPROD/presence_all_5/restore -d '{"indices": "quai_report_20170628", "ignore_unavailable": "true","rename_pattern": "quai_report_20170628(.+)","rename_replacement":"quai_report_20170628_2"}'
{"error":{"root_cause":[{"type":"snapshot_restore_exception","reason":"[WC1_BETAPROD:presence_all_5] cannot restore index [quai_report_20170628] because it's open"}],"type":"snapshot_restore_exception","reason":"[WC1_BETAPROD:presence_all_5] cannot restore index [quai_report_20170628] because it's open"},"status":500}

What am I doing wrong?

You need to close the destination index.

my issue was the rename pattern:

it needed to be this "rename_pattern": "quai_report_20170628"
I wasn't trying to overwrite the destination index, I was trying to create a copy of the destination index with _2 postfix

Once I made the change, it created the index I wanted.

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