Backup indices on Elasticsearch

Backup indices on Elasticsearch running on Windows

1. On each node, edit the "C:\ProgramData\Elastic\Elasticsearch\config\elasticsearch.yml" file and add the line:

path.repo: ["\\\\shared-storage\\backup_folder"]

2. Restart elasticsearch.

You will need a shared storage to which all the nodes have read/write access.

3. In the kibana dev tools, create a repository called fs_backup that will contain our snapshots. The "location" parameter should contain the name of the folder that will be created by the API call inside the backup_folder:

PUT /_snapshot/fs_backup

{

   "type": "fs",

   "settings": {

       "location": "snapshotsES",

       "compress": true

   }

}

4. Backup all the indices in a snapshot called snapshot_1 using a wildcard instead of the index name as below:

PUT /_snapshot/fs_backup/snapshot_1?wait_for_completion=true

{

 "indices": "*",

 "ignore_unavailable": true,

 "include_global_state": false

}