How to restore all indices from a snapshot location?

Hi,

I have created a snapshot and below is the structure of my snapshots using GET /_snapshot/ESSnapshots/* command.

{
  "snapshots": [
    {
      "snapshot": "mylogs1backup-20170920000007",
      "uuid": "XRpT_8feTneGpks2G9w94g",
      "version_id": 5000099,
      "version": "5.0.0",
      "indices": [
        "mylogs1-2017-09-10"
      ],
      "state": "SUCCESS",
      "start_time": "2017-09-20T00:00:07.947Z",
      "start_time_in_millis": 1505865607947,
      "end_time": "2017-09-20T00:02:39.190Z",
      "end_time_in_millis": 1505865759190,
      "duration_in_millis": 151243,
      "failures": [],
      "shards": {
        "total": 5,
        "failed": 0,
        "successful": 5
      }
    },
    {
      "snapshot": "mylogs2backup-20170920000240",
      "uuid": "O3CvBaJWRJOeV9tKBRpSSQ",
      "version_id": 5000099,
      "version": "5.0.0",
      "indices": [
        "mylogs2-2017-09-10"
      ],
      "state": "SUCCESS",
      "start_time": "2017-09-20T00:02:40.182Z",
      "start_time_in_millis": 1505865760182,
      "end_time": "2017-09-20T00:03:56.995Z",
      "end_time_in_millis": 1505865836995,
      "duration_in_millis": 76813,
      "failures": [],
      "shards": {
        "total": 5,
        "failed": 0,
        "successful": 5
      }
    },
	.
	.
	.
	.
	
  ]
}

and there are more. If I use

POST _snapshot/ESSnapshots/mylogs1backup-20170920000007/_restore

it will restore my snapshot. It works fine. But is there any option to restore all snapshots at once using a single command like;

POST _snapshot/ESSnapshots/*/_restore

This command creates error. Is there any way to restore all snapshots from single location?

Thanks in advance.

It is not possible, you will need to restore these snapshots one at a time. Typically different snapshots contain data from the same set of indices at different points of times. So, in a typical scenario restoring all snapshots at the same time would make little sense. You case is somewhat unique since you have one snapshot per index for some reason.

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