This site is for Avast Business products only. For articles on AVG Business products, see AVG Business Help. If you are in the right place but cannot find what you are looking for, please contact Avast Business Support for further assistance.

Backing Up, Restoring, and Moving On-Premise Console Database

This Article Applies to:

  • Avast Business On-Premise Console

 

This article describes the ways in which you can back up your On-Premise Console database, as well as restore or move it if needed.

Before you begin, please make sure to know your console's values. If you are unsure about them, you can check the configuration file (C:\Program Files\AVAST Software\Management Console\console\config\application-user-config.yml by default).

Backing Up

If you are able to ensure your HDD is properly backing up automatically (e.g. using RAID scheme), you don't need to perform any additional steps. Otherwise:

  • The following files must be backed up regularly:
    • C:\Program Files\AVAST Software\Management Console\console\config\application-user-config.yml
    • If you use your own certificate, then also everything under C:\Program Files\AVAST Software\Management Console\console\certificates
  • Configure a regular backup of a database using pg_dump and a task scheduling tool (such as Windows Task Scheduler)

You can perform the backup via Command Prompt or pgAdmin.

Performing Backups via Command Prompt

This backup method requires using the pg_dumpall application:

  • "C:\Program Files\ AVAST Software \Management Console\PostgreSQL\bin\pg_dumpall.exe" -U postgres -p 5432 -c -f C:\dump.sql

Replace the port number (default 5432 used here) in case you use a different port.

You will need the postgres password from the application-user-config.yml to perform the backup.

You will likely need to enter the password several times on-screen in order to back up all areas. If any part fails/is rejected, the backup will be incomplete.

With the application-user-config.yml and the contents of C:\Program Files\AVAST Software\Management Console\data, you would also be able to restore your database if required.

Performing Backups via pgAdmin

In pgAdmin, you can back up the database through right-clicking PostgreSQL10 and selecting Backup Server. A dialog to "configure the PostgreSQL Binary Path" might pop up at that point.

If that happens, it means some configuration is required. You will need to perform the following actions:

  1. Open File > Preferences
  2. Select Binary paths under Paths
  1. Enter the path to the pg_dump and pg_dumpall applications (C:\Program Files\AVAST Software\Management Console\PostgreSQL\bin by default)
    • The path is the folder, not a single .exe file.

  1. Save the changes when complete

Once the binary path is configured, you can run the backup via the Backup Server option.

By default, the file is backed up to the user Documents folder.

Restoring from Backup

The backup made by pgdump_all or the pgAdmin app can be restored using psql. Run the following command (replacing the port/backup file path if needed):

  • "C:\Program Files\ AVAST Software \Management Console\PostgreSQL\bin\psql.exe" -U postgres -p 5432 -f C:\dump.sql

To import the backup, you will again need the postgres password from the application-user-config.yml.

Moving On-Premise Console and Database to Another Device

If you need to move your On-Premise Console and its database to a new device, follow the below instructions ("new device" mentions refer to the device you are moving your console and database to, while "old device" mentions refer to the current device hosting your console and database).

When moving the database from an old device to a new one, the new device needs to have the same host name or IP address, depending on what was used for the "host" for device connections. Otherwise, the devices won't be able to connect and will need to be reinstalled after importing the database to the new device.

  1. Back up the existing database, and make sure you copy the existing application-user-config.yml file (it contains the password without which you won't be able to import the database backup):
    • "C:\Program Files\AVAST Software\Management Console\PostgreSQL\bin\pg_dumpall.exe" -U postgres -p 5432 -c -f C:\dump.sql
  2. On the new device, install the On-Premise Console, choosing offline/online as required
  3. Stop the Avast Business Management Console service on the new device
  1. Run the following commands to set the postgres/bconsole password the same as the old backed up database:
    • "C:\Program Files\AVAST Software\Management Console\PostgreSQL\bin\psql.exe" -U postgres -p 5432 -c "ALTER USER bconsole WITH PASSWORD '<oldymlpassword>';"
    • "C:\Program Files\AVAST Software\Management Console\PostgreSQL\bin\psql.exe" -U postgres -p 5432 -c "ALTER USER postgres WITH PASSWORD '<oldymlpassword>';"  
      • Replace <oldymlpassword> with the value from application-user-config.yml on the old device.
      • Replace the port number (default 5432 used here) in case you use a different port.
  1. The new device's password will be requested to make the changes - use the one from the application-user-config.yml on the new device
  1. Once done, open notepad.exe as admin and change the password in the new/existing application-user-config.yml to match the old password set in the database (step 4), as well as the shardContext, and keystore info (if using your own certificate)
  1. Import the backup using the following command::
    • "C:\Program Files\AVAST Software\Management Console\PostgreSQL\bin\psql.exe" -U postgres -p 5432 -f C:\dump.sql
      • Replace the port number (default 5432 used here) in case you use a different port.
      • The password from application-user-config.yml is required.
  1. Restart the Avast Business Management Console service on the new device and log in with the usual credentials