8.3 Using the zman command to Take a Backup of the Database

To back up an embedded database, run the zman db command on the server that has the database role.

The backup is created in the following location:

  • On Linux: /var/opt/microfocus/zenworks/common

  • On Windows: %ZENSERVER_HOME%\work

To configure the backup location and automatic backup schedule, go through the following steps:

  1. Go to the backup folder location.

    • On Linux: /var/opt/microfocus/zenworks/common

    • On Windows: %ZENSERVER_HOME%\work

    By default, the backup should be available in the ZCMDB_pg_dump or AuditDB_pg_dump folder.

  2. Go to the following location:

    • On Linux: /etc/opt/microfocus/zenworks/pgsql/pgsql-maintenance.xml

    • On Windows: %ZENSERVER_HOME%\conf\pgsql\pgsql-maintenance.xml

  3. Edit the backup location in the pgsql-maintenance.xml file.

  4. After editing the XML file, run microfocus-zenworks-configure -c AutomaticPostgresMaintenanceConfigureAction

  5. Restart the PostgreSQL service.

    • On Windows:

      To start the service, perform the following:

      • Press Windows + R keys.

      • Type services.msc.

      • Search for the ZENworks Embedded Datastore - PostgreSQL service.

      • Right-click the option and then select Restart.

    • On Linux: To start the service, run the systemctl restart zenpostgresql.service command.

  6. Run the command zman db. The database backup should be created in the location that was updated in the pgsql-maintenance.xml file.

  7. Modify the schedule in the pgsql-maintenance.xml file, and restart the ZENworks PostgreSQL service.

    Automatically the backup will be created in the location and schedule specified in the pgsql-maintenance.xml file.