Backup and Restore

The sections below show how to perform backup, teardown, and restore.

BACKUP

It is always a good idea to regularly back up your SevOne Data Insight instance.

sevone-cli playbook backup
This backs up the following to a backup directory with the date on which this command was run. i.e., ~/backups/YYYYMMDD.
  • MySQL Database
  • Security Keys
  • SevOne Data Insight Custom Configuration (yaml files in /opt/SevOne/chartconfs)
  • Map Background Assets
  • Custom Ansible Playbooks
  • Custom Widgets
  • TLS Certs
Warning: This will be the only copy of your backups. For more resiliency you should copy these files off of your SevOne Data Insight instance.

TEARDOWN

In some cases, it may be necessary to teardown the Kubernetes cluster.

sevone-cli cluster down

RESTORE

Warning: The restore playbook can only restore backups made by the backup playbook.
  1. All data can be restored by running the restore playbook.
    sevone-cli playbook restore
    

    You will be prompted with the date of the backup you wish to restore.

    
    what is the date of your backup (YYYYMMDD)?:
    

    Enter the date of the backup in YYYYMMDD format. For example, 20231205 for year = 2023, month = December, day = 5.

    To see the list of existing backups, run the following command.

    ls /home/sevone/backups/
    
  2. After restoring all the data, you will need to redeploy SevOne Data Insight.
    sevone-cli playbook up --tags apps
    

MANUAL RESTORES

If you have backups that were not taken by the backup playbook, you can restore them manually. Depending on the type of backup, the commands will vary. The following are a list of supported manual restoration steps.

➤   Manually Restore MySQL

Warning: Restoring MySQL requires a running SevOne Data Insight instance.
The required files are,
  • MySQL dump - likely located at ~/backups/<date>/mysqldump-*.sql.
  • Security keys - likely located at ~/backups/<date>/keys.json.
The restore playbook can only restore backups taken by the backup playbook.

To perform a manual restore,


MYSQL_STS=$(kubectl get sts -l app.kubernetes.io/name=mysql -oname)

SECRET=$(kubectl get secrets | grep securitykeys | awk '{print $1}')

kubectl rollout status -w $MYSQL_STS

kubectl delete secret $SECRET

kubectl create secret generic $SECRET --from-file=keys.json=/home/sevone/backups/keys.json

sevone-cli exec mysql -- mysql -uroot -pdatainsight < $(ls -Art ~/backups/mysqldump-*.sql | tail -n 1)

kubectl delete pods -l app.kubernetes.io/component=graphql