Restoring a snapshot
After you have taken snapshots of your data, they can be restored. The restoration process is often very fast; the indexed data is copied on the nodes and then activated.
Getting ready
You need a working ElasticSearch cluster and the snapshot created in the previous recipe.
How to do it...
To restore a snapshot, we will perform the following step:
- To restore a snapshot called
snap_1
for the indextest
andtest2
, the HTTP method isPUT
, and the curl command is:curl -XPOST "localhost:9200/_snapshot/my_backup/snap_1/_restore?pretty" -d '{ "indices": "test-index,test-2", "ignore_unavailable": "true", "include_global_state": false, "rename_pattern": "test-(.+)", "rename_replacement": "copy_$1" }'
The result will be as follows: ...
Get ElasticSearch Cookbook - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.