Restoring a snapshot
Once you have snapshots of your data, it can be restored. The restore process is very fast: the indexed shard data is simply copied on the nodes and activated.
Getting ready
You need an up-and-running Elasticsearch installation as we described in the Downloading and installing Elasticsearch recipe in Chapter 2, Downloading and Setup.
To execute curl
via the command line, you need to install curl
for your operative system.
To correctly execute the following command, the backup created in the previous recipe is required.
How to do it...
To restore a snapshot, we will perform the following steps:
To restore a snapshot called
snap_1
for thetest
andtest1
indices, the HTTP method isPUT
and thecurl
command is:curl -XPOST "http://localhost:9200/_snapshot/my_repository/snap_1/_restore? pretty" -d '{ "indices": "test-index,test-2", "ignore_unavailable": "true", "include_global_state": false, "rename_pattern": "test-(.+...