OpenCRVS
v1.2
Search…
⌃K

3.3.8 Clearing and restoring a server to factory reset data

It is also possible to clear and restore a server from factory reset reference data backup zips using similar commands to the full backup and restore.
​
THESE ARE DESTRUCTIVE ACTIONS. ALL YOUR OPENCRVS DATA IS DELETED AND RESTORED TO A FACTORY BACKUP.

Clearing and restoring from a factory reset backup, all data on a server

  1. 1.
    SSH into your server and navigate to the following directory:
cd /opt/opencrvs/infrastructure/
2. Ensure that your database secrets are available to the script as environment variables. You can do this by running:
export ELASTICSEARCH_ADMIN_USER=elastic \
export ELASTICSEARCH_ADMIN_PASSWORD=<your elastic password> \
export MONGODB_ADMIN_USER=< your mongo username> \
export MONGODB_ADMIN_PASSWORD=<your mongo password>
3. The clear all script is run like this:
Replace and separate the <parameters> with a space when calling the script
bash ./clear-all-data.sh <REPLICAS> <ENVIRONMENT>
4. Restore a factory reset like this:
Replace and separate the <parameters> with a space when calling the script
bash ./restore-metadata.sh <REPLICAS> <ENVIRONMENT>