It is good to keep in mind that we do not cover the process of registering a snapshot repository, creating SLM policies, or taking snapshots. Explore our related posts on the topics to learn how to accomplish the above.”
Elasticsearch Show Available Snapshots
The first step is to locate the available snapshots in your cluster. Run the request as shown to get your available snapshots:
The above request should fetch all the available snapshots in your cluster and return them as a JSON object.
An example output is as shown:
Once you locate the snapshot you wish to restore, we can proceed.
Elasticsearch Restore Index or Data Stream
Before restoring a specific index or data stream, ensure that it is included in the snapshot you wish to restore.
Start by deleting the index or data stream you wish to restore. This will prevent name collisions when restoring the data.
In this instance, we require to delete the netflix_copy index. We can delete the index by running the query:
The request above should drop the specified index or data stream from the cluster. Ensure that you have sufficient privileges on the target index before running the delete request.
To restore an index, use the syntax as shown:
For example, we can restore the netflix_copy index as shown in the request below:
Once you run the query above, the request should restore the index from the snapshot:
Elasticsearch Restore a Feature State
To restore a feature state from a given snapshot, we can run the request as;
"feature_states": [ "kibana" ]
The request above should restore the kibana feature from the specified snapshot.
Elasticsearch Restore Snapshot From Kibana
You can also perform snapshot restoration from the Kibana Dashboard. Navigate to Management -> Stack Management -> Snapshot and Restore.
Determine your target snapshot and select the “Restore” option.
Specify the restoration details such as global states, feature states, aliases etc.
Click Next to configure index settings during restoration. Here you can specify the index setting such as number of replicas, number of shards, etc. You can specify the settings of the index you wish to reset.
Click Next to review and start the restoration process.
Using this guide, you learned various methods and techniques for restoring an index, data stream or entire cluster from a snapshot.
Thanks for reading!!