How Do I Restore a SimpleRisk backup database? (All Installations)

Introduction

This short guide will help you restore a mysql backup of SimpleRisk’s database. This operation should take 5-10 minutes and will require the use of the root mysql user. 

Instructions

To begin you will need to identify the root mysql user password. For users who manually installed SimpleRisk on their platform of choice they will be responsible for locating their MySQL root password, below I will provide locations for automated installs default password locations:

RHEL 8 / CentOS 7 - /root/passwords.txt

Ubuntu 18.04/20.04 - /root/passwords.txt

Docker - /passwords/pass_mysql_root.txt

Next we begin the restoration process. This guide will assume your simplerisk backup is stored in the /tmp directory.  Now from terminal we use the following steps to restore the database:

Linux
1) mysql -u root -p (Login to the MySQL console using your root password)
2) DROP database `simplerisk`; (This will drop your current simplerisk database and delete it)
3) CREATE database `simplerisk;` (This creates the new database for us to import the data into)
4) quit (exit MySQL Console)
5) mysql -u root -p simplerisk < simpleriskbackup.sql

Windows

For Windows you may either use WAMPs built in phpadmin to drop the current simplerisk database and import the backup or the following from cmd.exe:

1) With cmd prompt open use “cd C:\wamp64\bin\mysql\mysql8.0.21\bin” (you may need to update path based on your MySQL version)
2) mysql -u root -p (Login in the MySQL console using your mysql root password)
3) DROP database `simplerisk`; (This will drop your current simplerisk database and delete it)
4) CREATE database `simplerisk`; (This creates the new database for us to import the data into)
5) quit (exit MySQL Console)
6) mysql -u root -p simplerisk < simpleriskbackup.sql

Summary

You have now restored your SimpleRisk backup and should be up and running again. If you have any trouble completing these steps or have any questions please contact us at support@simplerisk.com