Child pages
  • Backup and Restore

Versions Compared

Key

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

You may wish to backup your Open-AudIT data before upgrading or on a regular schedule. There are two main items to backup. The database and the files. 

Database backup

...

Code Block
languagebash
cd c:\xampp\mysql\bin
mysqldump -u openaudit -popenauditpassword --extended-insert=FALSE --routines openaudit > openaudit_backup.sql

Database Backup on Linux

...

languagebash

...

See here - Reset, Backup and Restore the Open-AudIT database

File Backup on Windows

You can either stop the MySQL and Apache services and then backup the entire c:\xampplite directory or only backup the c:\xampplite\open-audit directory. You don't really need all of the XAMPPLite directories as you can simply use the reinstall at a later stage. If you backup your open-audit directory you will have the config files as well as any uploaded attachments.

...

On both Windows and Linux you might wish to compress (zip or tar.gz) the resulting database and directory files.

Restoring

...

Run the install program to install and setup Open-AudIT. You can then copy your backup file and restore the database with:

Code Block
languagebash
copy openaudit_backup.sql c:\xampp\mysql\bin\

cd c:\xampp\mysql\bin

mysql -u openaudit -popenauditpassword openaudit < openaudit_backup.sql

Restoring on Linux

Is almost the same as Windows. Copy the database backup to /tmp and import it into MySQL.

Code Block
languagebash
cp openaudit_backup.sql /tmp/

mysql -u openaudit -popenauditpassword openaudit < /tmp/openaudit_backup.sql

Restore the database as per - Reset, Backup and Restore the Open-AudIT database

Once the database has been restored, you may need to go into the web application and run the Admin -> Upgrade routine (if you have not restored to the same version of the program as the backups backed up database version).

You can also just copy the backed up files back to their original location, overwriting any existing files (if you haven't upgraded between backup and restore).

NOTE - If you have upgraded versions in between backup and restore, ONLY only restore the config directory (open-audit/code_igniter/application/config) and , the attachments directory (open-audit/code_igniter/application/attachments) and the custom images directory (Linux - /usr/local/open-audit/www/open-audit/customer_images, Windows - c:\xampp\htdocs\open-audit\custom_images). If you overwrite the other (Open-AudIT program) files, you will effectively reverse the upgrade you have performed.

NOTE #2 - 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');"