7.2 Backing up the Database on the Embedded Primary Server

  1. Run the following commands and note down the ZENworks database credentials of the source machine:

    • zman dgv

    • zman dgca

    • zman dgcs

    • zman dgcam

  2. Stop the ZENworks Services on all the Primary Servers by running the following configure action:

    microfocus-zenworks-configure -c Start

    After running the command, under Action, select Stop.

  3. On the Primary Server on which the Embedded Database is installed, start the Micro Focus ZENworks Embedded Datastore service using the following steps:

    On Windows: Press the Win + R keys on the keyboard to open the Run window. Type services. msc and then hit Enter.

    Start the Micro Focus ZENworks Embedded Datastore – PostgreSQL service.

    On Linux: Run the following command to start the Micro Focus ZENworks Embedded Datastore – PostgreSQL service.

    • On SLES 12 and later: systemctl start zenpostgresql.service

  4. Login to the Primary Server that has the database role.

  5. Initiate the backup by setting the following variables:

    • PGPORT: <existing source DB port configured>

      By default, ZENworks uses 54327

    • PGDATA: <embedded_database_location>

    • PGUSER: <existing super user for ZENworks postgres DB> The default user for ZENworks is zenpostgres.

    • PGDATABASE: <existing database name> ZENworks default is postgres

    • PGPASSWORD: <password for the above super user PGUSER>

    Example 7-1 Example for Windows Primary Server

    Open the command prompt and set the following variables based on the existing configuration.

    • SET PGPORT=54327

    • SET PGDATA= %ZENSERVER_HOME%\database\pgsql\data

    • SET PGUSER=<super user retrieved from zman dgcs>

    • SET PGDATABASE=postgres

    • SET PGPASSWORD=<password retrieved from zman dgcs>;

    Example 7-2 Example for Linux Primary Server:

    Open the terminal and set the following variables based on the existing configuration.

    • export LD_LIBRARY_PATH=/opt/microfocus/zenworks/share/pgsql/lib$LD_LIBRARY_PATH;

    • export PATH=$PATH:/opt/microfocus/zenworks/share/pgsql/bin;

    • export PGPORT=54327;

    • export PGDATA=/var/opt/microfocus/pgsql/data;

    • export PGUSER=<super user retrieved from zman dgcs>;

    • export PGDATABASE=postgres;

    • export PGPASSWORD=<password retrieved from zman dgcs>;

  6. Run the following commands to back up both the databases (ZENworks and Audit):

    • On Windows:

      • cd "%ZENSERVER_HOME%\share\postgres\bin\"

      • pg_dumpall.exe > "<path to sql file>"

        Example: pg_dumpall.exe > c:\postgres_dump.sql

    • On Linux:

      • cd /opt/microfocus/zenworks/share/pgsql/bin/

      • ./pg_dumpall > "<path to sql file>"

        Example: ./pg_dumpall > /tmp/postgres_dump.sql