Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
c:\xampp\mysql\bin\mysql.exe -u openaudit -popenauditpassword openaudit < c:\temp\openaudit_mysql.sql


NOTE - If you restore the database onto a fresh install or an upgraded install, you will need to update your tasks (if you have any). Run the below.

Windows -

Code Block
c:\xampp\mysql\bin\mysql.exe -u openaudit -popenauditpassword openaudit -e "UPDATE tasks SET uuid = (SELECT value FROM configuration WHERE name = 'uuid');"

Linux -

Code Block
mysql -u openaudit -popenauditpassword openaudit -e "UPDATE tasks SET uuid = (SELECT value FROM configuration WHERE name = 'uuid');"


Moving the Database Files on Windows

...

NOTE - the actual data in g:\data has not been deleted and is left for the user to do.



Restoring the database on another machine

First back-up the database as above.

On the new machine, install MySQL.

For all steps, you will need to know the MySQL root users password.

  • If MySQL root user has a password, all commands below should use the -p switch so you can input the password.
  • If MySQL root user does not have a password, use as below.

Create a new instance of a database

Code Block
languagesql
mysql -u root -e "CREATE DATABASE openaudit;"

Create the Open-AudIT user.

Code Block
languagesql
mysql -u root -e "CREATE USER openaudit@localhost IDENTIFIED BY 'openauditpassword';"

And allow the user access to the database.

Code Block
languagesql
mysql -u root -e "GRANT ALL PRIVILEGES ON openaudit.* TO openaudit@localhost IDENTIFIED BY 'openauditpassword'; FLUSH PRIVILEGES;"

Copy the database backup file to the new machine (in this case to /tmp/openaudit_mysql.sql).

Restore the database, as above.