How to migration MD Core postgresql database deployed on dedicated PostgreSQL server?

Check Your Version:

This article applies to all MD Core releases deployed on Windows and Linux systems. This guide walks you through migrating your MetaDefender Core PostgreSQL database to a new server. 

Prerequisites 

  • Set up a new PostgreSQL server that is network-reachable by all MD Core servers. 

 Migration Steps 

Step 1: Stop MD Core Services 

Stop all MD Core instances that are connected to the shared MD Core database. 

Step 2: Back Up the Existing Database 

On the original PostgreSQL server, back up the metadefender_core database: 

pg_dump.exe --file "C:\Core_DB_backup\metadefender_core.backup" --host "127.0.0.1" --port "5432" --username "postgres" --format=c --blobs --no-owner --no-privileges --verbose "metadefender_core" 

Note: Adjust --host, --port, and --username if your setup differs from the defaults shown above. 

Step 3: Create the New Database 

On the new PostgreSQL server, create an empty database using the same name as the original (metadefender_core). 

Step 4: Restore the Backup 

Restore the backup file onto the newly created database: 

pg_restore --host "127.0.0.1" --port "5432" --username "postgres" --dbname "metadefender_core" --verbose "C:\Core_Db_backup\metadefender_core.backup" 

Note: Adjust --host, --port, and --username if your setup differs from the defaults shown above. 

Step 5: Update MD Core Configuration 

Point MD Core to the new PostgreSQL server by running(default path): 

C:\Program Files\OPSWAT\MetaDefender Core\ometascan-change-db-credentials.exe 

Follow the prompts to enter the new server's connection details. 

Actions required after migration 

Once configuration is updated: 

  1. Start your MD Core service. 

  1. Login to MD Core UI 

  1. Verify connectivity to the new database: “Settings” option à “Network” Tab à “Database” section 

Support:

If Further Assistance is required, please proceed to log a support case or chatting with our support engineer.