# Snapshot and Restore for Standalone Server

## **Prerequisites**

  • To perform a snapshot and restore, make a copy of config.xml:

  • Create the folder `C:/SearchBloxServer/backup/data` in Windows, `/opt/searchblox/backup/data` in Linux.

  • Please give a relevant path as per your OS in the following steps.

## **Steps to Take Snapshot**

  1. Enter the path where you want to store the indexed data in elasticsearch.yml `path.repo: C:/SearchBloxServer/backup/data`

  2. Restart SearchBlox to reflect the changes. (We recommend using Kibana dev tool for running Snapshot & Restore commands)

  3. Create a repository



Expected Response:

654


**Kibana Console Output**

  1. Confirm that the repository has been created



Expected Response:

520


**Kibana Console Output**

  1. Taking a Snapshot of the cluster



Expected Response:

544


**Kibana Console Output**

  1. Copy the folder C:/SearchBloxServer/backup to the new standalone server on the same path.

## **Restore Data in another Server**

  1. Go to elasticsearch.yml and enter `path.repo: C:/SearchBloxServer/backup/data`

  2. Copy the config.xml from the indexing server to `<SEARCHBLOX_INSTALLATION_PATH>/searchblox/WEB-INF/config.xml`

  3. Restart SearchBlox.

  4. Register a snapshot in the new server.



Expected Response:

654


**Kibana Console Output**

  1. Check the snapshot



Expected Response:

501


**Kibana Console Output**

  1. Close all SearchBlox collection indices using the following. Use idx* to close relevant indices created in SearchBlox



Expected Response:

582


**Kibana Console Output**

  1. Restore using the following post



Expected Response:

518


**Kibana Console Output**

  1. Open all the Indices



Expected Response:

409


**Kibana Console Output**

# Snapshot and Restore in Cluster for Linux

  • There is a prerequisite for snapshot and restore operation to work on a cluster in Linux OS.

  • For the snapshot and restore commands to work directly or from the utility, it is required to make `/opt/searchblox/backup` folder of index server (where the backup and restore actions to be performed) to be accessible in the search servers.

  • You can mount the folder using tools such as NFS or Samba to make the folders accessible across the search servers.

  • External link for folder sharing [https://www.howtoforge.com/nfs-server-and-client-on-centos-7](🔗).

  • Based on your OS used please share the folder where the backup is taken to be accessible directly in the same path in other servers. Only then backup and restore would work from the utility.

# Snapshot and Restore in Amazon S3

## **Prerequisites**

  • Create an S3 bucket if you don’t already have one.

  • Go to `../elasticsearch/bin` and install s3 repository plugin using the following command (command prompt for Windows and terminal for Linux)


  • Add your AWS access and secret keys to the Elasticsearch keystore using the commands in the path `<SEARCHBLOX_INSTALLATION_PATH>/elasticsearch/bin`

  • If you are not able to run the following commands please delete elasticsearch.keystore.tmp file



## **Steps to Take Snapshot**

  1. Register the repository using the JSON



Expected Response:

654


**Kibana Console Output**

  1. Take a snapshot of the cluster



Important Information

It might take sometime to get a response, sometimes you may get statuscode 504 with a timeout error. However most likely with time out error the data backup might be successful.

  1. Check the snapshot created



Expected Response:

664


**Kibana Console Output**

## **Restore Data in another Server**

  1. Retrieve the snapshot created in your other server



Expected Response:

664


**Kibana Console Output**

  1. Close all SearchBlox collection indices using the following. Use idx* to close indices created in SearchBlox



Expected Response:

582


**Kibana Console Output**

  1. Restore using the following post



Expected Response:

518


**Kibana Console Output**

  1. Open all the Indices



Expected Response:

409


**Kibana Console Output**