PostgreSQL : Backup and Restore Zenworks databases using PostgreSQL client

  • 7024568
  • 17-Apr-2020
  • 16-Sep-2020


ZENworks Configuration Management 2020 Database


By default the Zenworks 2020 contains two PostgreSQL databases


One task of database maintenance is the backup of the database.


Preferred:  Refer to the ZENworks 2020 and later documentation for how to use zman to backup and restore the database:


Using existing tool to back up and restore the databases.

First please use the commands
zman dgc
zman dgca
to retrieve the username and password of the database owners. The command requires authentication as zone administrator.

'zman dgc' outputs the credentials of the zenworks database owner.
'zman dgca' outputs the credentials of the zenworksaudit database owner.


The database is backed up using the tool pg_dump.   Note:  On SLES servers, it's necessary to run the following before running pg_dump:

export LD_LIBRARY_PATH=/opt/novell/zenworks/share/pgsql/lib:$LD_LIBRARY_PATH 

pg_dump is located in /opt/novell/zenworks/share/pgsql/bin/

Please login as root on the command line interface
Run the command

/opt/novell/zenworks/share/pgsql/bin/pg_dump -h localhost -p 54327 -U zenadmin zenworks > /<Path_to_backup_location>/zenworks-backup.sql

to backup the zenworks database.
Run the command

/opt/novell/zenworks/share/pgsql/bin/pg_dump -h localhost -p 54327 -U zenauditadmin zenworksaudit > /<Path_to_backup_location>/zenworksaudit-backup.sql

to backup the zenworksaudit database.


The database is restored using the tool psql
Run the command

/opt/novell/zenworks/share/pgsql/bin/psql -h localhost -p 54327 -U zenadmin zenworks < /<Path_to_backup_location>/zenworks-backup.sql

to restore the database zenworks from the backup file zenworks-backup.sql

Run the command

/opt/novell/zenworks/share/pgsql/bin/psql -h localhost -p 54327 -U zenauditadmin zenworksaudit < /<Path_to_backup_location>/zenworksaudit-backup.sql

to restore the zenworksaudit database from the backup file zenworksaudit-backup.sql

Additional Information

The instructions as described above apply only to the embedded installation of PostgreSQL server on ZCM 2020.
For external PostgreSQL installation the port may be different, the location of the tool 'pg_dump' may be different.
Adding '/opt/novell/zenworks/share/pgsql/bin/' to $PATH, so PostgreSQL commands could be found without full path.
Run the command

zman asc administrator

and enter the password of administrator to store the password.