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:

    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>

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

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

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

    • docker exec -e PGUSER=<super user retrieved from zman dgcs> -e PGDATABASE=postgres -e PGPASSWORD=<password retrieved from zman dgcs> zenpostgres /opt/microfocus/zenworks/share/pgsql/bin/pg_dumpall > /tmp/dump.sql

      Example: docker exec -e PGUSER=zenpostgres -e PGDATABASE=postgres -e PGPASSWORD=Zw0#43cf4525d0f5df6395bbbec9c zenpostgres /opt/microfocus/zenworks/share/pgsql/bin/pg_dumpall > /tmp/dump.sql

      NOTE:You can ignore the no version information available error message.