How to clone multiple indices at once within Kibana DevTools

Hello

Is it possible to clone multiple indices in one shot?

I tried:

POST /test-13,test-14,test-15/_clone/test-clone

Unfortunately I'll get an error:

{
  "error" : {
    "root_cause" : [
      {
        "type" : "index_not_found_exception",
        "reason" : "no such index [test-13,test-14]",
        "index_uuid" : "_na_",
        "index" : "test-13,test-14"
      }
    ],
    "type" : "index_not_found_exception",
    "reason" : "no such index [test-13,test-14]",
    "index_uuid" : "_na_",
    "index" : "test-13,test-14"
  },
  "status" : 404
}

Questioning how to iterate over source indices within Kibana DevTools?

Hi @fim01. It looks like you are trying to concatenate multiple indices into a single index. The _clone endpoint does not support this as it only supports a single source index to a single destination index.

I believe you may want to review the Index Lifecycle Management documentation instead. Particularly the section on Managing existing indices may help you.

Thanks Nick for your reply.

ILM is in fact already active. The problem I try to solve. I've 350+ indices (each 4GB+) and want to save them for later use. _reindex into a single index takes 12 days (approx. calculation) which is not acceptable for us.

Hence I tried with _clone api which is extremly fast. But now I have to type manually 350 times different source and destination index name.

Hence my question, is there a for-loop available in Kibana DevTools?

It doesn't matter whether I have a single index or same number of indices after the _clone.

Hence my question, is there a for-loop available in Kibana DevTools?

No, there is no for loop in DevTools. I would recommend something like a bash process. Perhaps you could modify the example in the Reindex documentation to use the _clone endpoint?

Thank you for the hint!
Finally we performed the manipulations with a python script.

curl -X POST https://localhost:9200/srcidx/_clone/dstidx?pretty

1 Like

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