Hi all,
I attach the step by step procedure to perform a PostgreSQL Database upgrade.
- Ensure that there are no jobs or restore tasks occurring.
- Manually Create a Configuration Backup.
- (Optional) Create a backup of the Configuration Database.
- Stop and Disable all Jobs
- Stop all Veeam services on the Veeam Backup Server
- Upgrade the SQL database software.
- After the upgrade completes, restart the Veeam Backup Server
PostgreSQL Upgrade Procedure
- Ensure all jobs, policies, and tasks are stopped, and those that are scheduled to run are disabled.
- Stop all Veeam-related services on the Veeam Backup Server.
- Get-Service Veeam* | Stop-Service -Force

- Download the latest version of PostgreSQL that is compatible with Veeam Backup & Replication.
Note: The most recent version of PostgreSQL may not be supported by Veeam Backup & Replication, it is critical that you check the compatibility list in the Veeam Backup & Replication User Guide for details.

- Identify VBR Database
$activeConfig = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Veeam\Veeam Backup and Replication\DatabaseConfigurations' -Name 'SqlActiveConfiguration').SqlActiveConfiguration
if ($activeConfig -eq "MsSql") {
$sqlServerName = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Veeam\Veeam Backup and Replication\DatabaseConfigurations\MsSql' -Name 'SqlServerName').SqlServerName
$sqlInstanceName = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Veeam\Veeam Backup and Replication\DatabaseConfigurations\MsSql' -Name 'SqlInstanceName').SqlInstanceName
$sqlDatabaseName = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Veeam\Veeam Backup and Replication\DatabaseConfigurations\MsSql' -Name 'SqlDatabaseName').SqlDatabaseName
Write-Host " Database Engine: $($activeConfig) "
Write-Output "Connection Settings: $($sqlServerName)\$($sqlInstanceName)"
Write-Output "Database Name: $($sqlDatabaseName)"
} elseif ($activeConfig -eq "PostgreSql") {
$pgServerName = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Veeam\Veeam Backup and Replication\DatabaseConfigurations\PostgreSql' -Name 'SqlHostName').SqlHostName
$pgPortNumber = (Get-ItemPropertyValue -Path 'HKLM:\SOFTWARE\Veeam\Veeam Backup and Replication\DatabaseConfigurations\PostgreSql' -Name 'SqlHostPort')
$pgDatabaseName = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Veeam\Veeam Backup and Replication\DatabaseConfigurations\PostgreSql' -Name 'SqlDatabaseName').SqlDatabaseName
$pgUser = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Veeam\Veeam Backup and Replication\DatabaseConfigurations\PostgreSql' -Name 'PostgresUserForWindowsAuth').PostgresUserForWindowsAuth
Write-Host "Database Engine: $($activeConfig)"
Write-Output "Connection Settings: $($pgServerName):$($pgPortNumber)"
Write-Output "Database Name: $($pgDatabaseName)"
Write-Output "PostgreSQL User: $($pgUser)"
}

- Identify VEM Database
$activeConfig = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Veeam\Veeam Backup Reporting\DatabaseConfigurations' -Name 'SqlActiveConfiguration').SqlActiveConfiguration
if ($activeConfig -eq "MsSql") {
$sqlServerName = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Veeam\Veeam Backup Reporting\DatabaseConfigurations\MsSql' -Name 'SqlServerName').SqlServerName
$sqlInstanceName = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Veeam\Veeam Backup Reporting\DatabaseConfigurations\MsSql' -Name 'SqlInstanceName').SqlInstanceName
$sqlDatabaseName = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Veeam\Veeam Backup Reporting\DatabaseConfigurations\MsSql' -Name 'SqlDatabaseName').SqlDatabaseName
Write-Host " Database Engine: $($activeConfig) "
Write-Output "Connection Settings: $($sqlServerName)\$($sqlInstanceName)"
Write-Output "Database Name: $($sqlDatabaseName)"
} elseif ($activeConfig -eq "PostgreSql") {
$pgServerName = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Veeam\Veeam Backup Reporting\DatabaseConfigurations\PostgreSql' -Name 'SqlHostName').SqlHostName
$pgPortNumber = (Get-ItemPropertyValue -Path 'HKLM:\SOFTWARE\Veeam\Veeam Backup Reporting\DatabaseConfigurations\PostgreSql' -Name 'SqlHostPort')
$pgDatabaseName = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Veeam\Veeam Backup Reporting\DatabaseConfigurations\PostgreSql' -Name 'SqlDatabaseName').SqlDatabaseName
$pgUser = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Veeam\Veeam Backup Reporting\DatabaseConfigurations\PostgreSql' -Name 'PostgresUserForWindowsAuth').PostgresUserForWindowsAuth
Write-Host "Database Engine: $($activeConfig)"
Write-Output "Connection Settings: $($pgServerName):$($pgPortNumber)"
Write-Output "Database Name: $($pgDatabaseName)"
Write-Output "PostgreSQL User: $($pgUser)"
}

- Check PostgreSQL version

- Backup PostgreSQL from CLI
Backup PostgreSQL from CLI
cd "C:\Program Files\PostgreSQL\15\BIN"
pg_dump -U postgres -d “yourDB-name” > C:\BackupPostgreSQL15\“yourDB-name” sql
pg_dump -U postgres -d “yourDB-name” > C:\BackupPostgreSQL15\“yourDB-name”.sql


- Lunch installer\upgrade
C:\temp\postgresql-15.11-1-windows-x64.exe --mode unattended --disable-components stackbuilder

Reboot VBR re – enable jobs check version PostgreSQL

regards & enjoy