Overview

This document aims to describe how to back up the ZENworks Mobile Workspace database and how to restore it in case of crash.

Backup the Databases

Start the database manager

  • On Windows, launch [ZENworksMobileWorkspace_HOME]\databases\db_manager.bat

  • On Linux, execute [ZENworksMobileWorkspace_HOME]\databases\db_manager.sh

Once started, IJ prompt should be displayed along with connections information:

------------------------------------------------------------
CONNECTING TO SENSE DATABASE...
------------------------------------------------------------
------------------------------------
TO DISCONNECT FROM A DATABASE, TYPE:
------------------------------------

disconnect;

--------------
TO QUIT, TYPE:
--------------

exit;

--------------
ij version 10.11
ij>

Connect to the database

Simply copy/paste the displayed command according to the database you want to backup:

ij> connect 'jdbc:derby://localhost:1527/sense-sec-server;bootPassword=myPassword;user=sense_sec;password=myPassword;';

Press “Enter” key. If the connection succeeds, IJ will display an new prompt line:

ij>

Execute the backup command

Once connected, execute the following command to backup the database to a selected location (D:\Backup\2017-03-03\ in our example):

ij> CALL SYSCS_UTIL.SYSCS_BACKUP_DATABASE(‘D:\Backup\2017-03-03');

Press “Enter” key. If the command succeeds, this is what will be displayed:

Statement executed.
ij>

Disconnect from the database

You can now disconnect from the database with this command:

ij> disconnect;

Press “Enter” key. IJ will display an new prompt line:

ij>

You can now connect to the other database or quit the DB Manager.

Exit the database manager

Run the following command to close the DB manager:

ij> exit;

Restore The Database

Stop ZENWorks Services

To restore the database, it is important to shut down the ZENworks Mobile Workspace server. Otherwise, the server will lock the database files preventing files to be replaced by the backup.
  • On Windows:

    • Launch the Microsoft Windows Services Console (services.msc)

    • Stop “SENSE-SERVER” service

    • Stop “SENSE-DB” service

  • On Linux:

    • Open a shell prompt

    • Execute command: systemctl stop tomcat

    • Execute command: systemctl stop derby

Start the database manager

Follow the instructions: Start the database manager.

Connect to the database with restore command

ij> connect 'jdbc:derby://localhost:1527/sense-sec-server;bootPassword=myPassword;user=sense_sec;password=myPassword;restoreFrom=D:\Backup\2017-03-03\sense-sec-server;';

No confirmation/error message is logged by the command. Only a new prompt line will be displayed at the end of the restore process.

Disconnect from the database

Follow the instructions: Disconnect from the database.

Exit the database manager

Follow the instructions: Exit the database manager.

Start ZENWorks Services

Please note that is important to start the database service before starting the application server.

  • On Windows:

    • Launch the Microsoft Windows Services Console (services.msc)

    • Start “SENSE-DB” service

    • Stop “SENSE-SERVER” service

  • On Linux:

    • Open a shell prompt

    • Execute command: systemctl stop derby

    • Execute command: systemctl stop tomcat