Backing Up and Restoring the Database

This section provides the steps to perform backing up the database (MariaDB) data. It also provides the steps to schedule a regular backup in a Windows scheduler.

Running the script for Backing Up

To back up MariaDB data, run the following script on Vocera Analytics server:

rem create backup folder if not exist
if not exist %VA_HOME%\backup mkdir %VA_HOME%\backup

rem format is yyyymmdd_hhmmssss
set datetime=%date:~10,4%%date:~4,2%%date:~7,2%_%time:~0,2%%time:~3,2%%time:~6,2%%time:~9,2%

%VA_HOME%\MariaDB\bin\mysqldump -uanalyticsuser -pDBPassword -B ldg vocera_analytics vocera_meta > "%VA_HOME%\backup\db-backup_%datetime: =0%.sql"

The following section provides more information about the script:

Note: The backup script takes only the logical backup of the database. The script takes the backup of database table schema, views, and data. However, it does not take backup of stored procedures.

Scheduling MariaDB Backup

To schedule a backup, perform the following steps:

  1. Copy dbbackup.bat file that contains the script to VoceraAnalytics folder if it does not exist.
  2. Click Start and type Task in Search programs and files.

    The Task Scheduler is displayed.

  3. Click Task Scheduler.

    The Task Scheduler program opens.

  4. Select Actions>Create Basic Task.

    The Create Basic Task Wizard appears.

  5. Perform the following actions:
    • Create a Basic Task—Enter the name, and the description of the task.

    • Trigger>When do you want the task to start—Select one of the options displayed in the screenshot.

    • Action>What action do you want the task to perform—Select Start a program.

      Click Browse and select the batch file you need to run.

    • Click Next.

      The Finish screen appears.

    • Click Finish.

      A basic task is created.

Restoring MariaDB

This section describes the steps to restore Vocera Analytics database.

To restore MariaDB data, perform the following tasks:

  1. Open command prompt with administrative privileges and run dbrestore.bat file.
  2. Run the following script on Vocera Analytics server:
    %VA_HOME%\MariaDB\bin\mysql -u analyticsuser -p DBPassword < C:\VoceraAnalytics\backup\db-backup_20180301_00544270.sql
    

The following section provides more information about the script: