Would you like to learn how to create an ElasticSearch Snapshot? In this tutorial, we are going to show you how to create the Snapshot of an ElasticSearch index on a computer running Ubuntu Linux.
• Ubuntu 18
• Ubuntu 19
• Ubuntu 20
• ElasticSearch 7.6.2
In our example, The ElastiSearch server IP address is 192.168.100.7.
Important! The Elasticsearch uses the word Index instead of the word Table.
ElasticSearch Related Tutorial:
On this page, we offer quick access to a list of tutorials related to ElasticSearch installation.
Tutorial ElasticSearch – Creating a Snapshot
Install the required packages.
Test your communication with the ElasticSearch server.
Here is the command output:
Stop the ElasticSearch service.
Create a local directory to store the Snapshot.
Edit the ElasticSearch configuration file named: elasticsearch.yml
Add the following line at the end of the file.
Here is the original file, before our configuration.
Here is the file with our configuration.
Start the ElasticSearch service.
Register a new Snapshot repository named BACKUP.
Here is the command output:
List all Snapshot repositories.
Here is the command output:
Create a Snapshot of the ElasticSearch database.
Here is the command output:
In our example, we created a snapshot named SNAPSHOT_001.
In our example, we stored this snapshot inside the repository named: BACKUP.
This Snapshot stores all the Elasticsearch information.
To create a Snapshot of a specific ElasticSearch index, use the following command.
Here is the command output:
In our example, we created a snapshot named SNAPSHOT_INDEX_ACCOUNT_001.
In our example, we stored this snapshot inside the repository named: BACKUP.
This Snapshot stores only the index named ACCOUNTS.
List all Snapshots available on the repository named BACKUP.
Here is the command output:
Use this command to list information from a specific Snapshot.
Here is the command output:
In our example, we listed the information from a Snapshot named SNAPSHOT_001 that was stored on the repository named BACKUP.
Congratulations! You created an ElasticSearch Snapshot.
Tutorial ElasticSearch – Restoring a Snapshot
Install the required packages.
Test your communication with the ElasticSearch server.
Here is the command output:
Restore the ElasticSearch Snapshot named: SNAPSHOT_INDEX_ACCOUNT_001
Here is the command output:
In our example, we restored the backup of an Elasticsearch index named ACCOUNTS.
If you received the following error message, you need to close the ElasticSearch index before restoring the Snapshot.
To close the Elasticsearch index, use the following command.
Here is the command output:
Congratulations! You restored the ElasticSearch Snapshot.