Skip to main content

Alternative method: How to Upgrade PostgreSQL Minor Version Used by Veeam Backup & Replication


Iams3le
Forum|alt.badge.img+11

PostgreSQL is a relational database management system (RDBMS) for storing and managing data. The default installations of Veeam Backup & Replication from v12 uses PostgreSQL. This is due to various reasons as described in the following articles: how to Migrate Veeam Configuration Database to PostgreSQL Server.

Note: At the time of writing this guide, Veeam still recommended to use Microsoft SQL Server when you backup more than 5000 VMs.

 

There are numerous reasons for upgrading the PostgreSQL Engine used by VBR? I will therefore refer you to the following release note.

 

Determine the PostgreSQL version and Backup

Before proceeding, verify Veeam’s official support for the target PostgreSQL version (system requirements for the compatibility list). At the time of writing this article, Veeam currently supports “local or remote” installation of the following versions of PostgreSQL instance for the Configuration Database.

  • PostgreSQL 14.x
  • PostgreSQL 15.x (PostgreSQL 15.13 is included in the Veeam Backup & Replication 12.3 setup).

To determine my current PostgreSQL version, please launch pgAdmin as shown below

For best practive, I will recommend that you create a backup of the postgresql database backup. To do this, right-click on the Veeam database and select “Backup”.

the backup will start and should end very shortly.

 

Essential Steps to Take Before Upgrading PostgreSQL

Stop all backup jobs as shown below.

 

Create a configuration backup. To do this, click on the Hamburger menu and select configuration backup.

Click on backup now. As you can see, the backup is being processed.

 

Proceed and stop all Veeam related services

 

Alternatively, you could use the following command below to stop all veeam related services.

1Get-Service Veeam* | Stop-Service -Force

 

How to upgrade PostgreSQL Engine

All PostgreSQL update releases include all fixes and improvements from earlier updates within the same major version. Each new update builds on the previous ones, so when you upgrade from version 15.6 to 15.13 as it is in my case. You automatically get everything introduced in 15.6 and 15.13 as well.

Please, proceed and download the latest version of PostgreSQL. As you can see below, upon clicking on the supported platform to download, the download will start.

Method 1: Upgrading within the same major version (e.g., 15.6 → 15.13)

Installing packages with a new version of PostgreSQL. It is suitable only for minor updates. Before performing the update, study the release notes. This involves updating the existing binaries (replacing the executables) with those from the new version, assuming no changes to the data directory format as we will see very shortly.

Note: Here, no dump, restore, or pg_upgrade is required. This method is also fast and safe.

Since, this is a minor update, and you can safely stop the postgreSQL service as shown below.

 

Next, install the new version (same major version). This will replace the binaries, and do not forget to restart the service. Please, see how to “Install PostgreSQL on Windows server as Veeam Database Engine“.

During installation, please keep the same directory data for postgresql. When the installation completes, reboot your Veeam Server and re-enable Veeam jobs.

An existing PostgreSQL installation has been found. Please click next to upgrade it
 

Select Next on the “Existing data directory”

 

Click the Next button on the Pre-installation Summary window

 

Installation progress

Uncheck the stack builder as you wish

The PostgreSQL service is usually started automatically. I will recommend that you verify this, as shown below by launching the services manager

Launch pgAdmin to determine the version upgrade.

 

Next, start all Veeam services as shown below

1Get-Service -Name 'Veeam*' | Where-Object {$_.Status -ne 'Running'} | Start-Service

 

All the services are running


Method 2: Via the standard pg_dumpall program

This method has been discuss by ​@Link State extensively and as such, I will show you in a subsequent blogpost how to use it with a different perspective. 

 

This is a more reliable method, but it may sometimes require a longer downtime. Kindly communicate the downtime with your stakeholders. I will demonstrate this step when Veeam decides to support a different version of PostgreSQL, say version 16.

Back up your database using pg_dumpall as shown below.

1pg_dumpall -U postgres -f alldb_backup.sql

All we need to do is ensure that the service is stopped as shown below.


Install the new PostgreSQL version (e.g., 15.13) using the EnterpriseDB installer as discussed below

 

Restore your data

1psql -U postgres -f alldb_backup.sql

 

When complete, ensure all services are running and re-enable your jobs. Interested in taking a look at the original blog post, here is the link.

 

Method 3: Via the Standard pg_upgrade program

If you hate the KISS principle and like to over complicate thing, then you can use this method 😁

When you upgrade PostgreSQL to a new major version, you can also use the pg_upgrade tool to update your existing data files. This method avoids the need for a full data dump and reload, which can be time-consuming, especially with large datasets. PostgreSQL provides a Windows-compatible version of pg_upgrade. Please, take a look at this GitHub page for more information. Also, see this link for more information.

 

10 comments

Chris.Childerhose
Forum|alt.badge.img+21

Great article on the PG upgrade. We can also add a fourth method if installed on Linux using the built in tool there as well. 👍


Iams3le
Forum|alt.badge.img+11
  • Author
  • Veeam Legend
  • 1511 comments
  • May 26, 2025
Chris.Childerhose wrote:

Great article on the PG upgrade. We can also add a fourth method if installed on Linux using the built in tool there as well. 👍

I agree! That is a potential blogpost when I get a new appliance for v13! 


Chris.Childerhose
Forum|alt.badge.img+21
Iams3le wrote:
Chris.Childerhose wrote:

Great article on the PG upgrade. We can also add a fourth method if installed on Linux using the built in tool there as well. 👍

I agree! That is a potential blogpost when I get a new appliance for v13! 

Yeah not even the appliance for v13 just standard Linux with PG installed like Ubuntu as an example which I use.


matheusgiovanini
Forum|alt.badge.img+6

Really great and comprehensive guide ​@Iams3le. Thanks for sharing.


Link State
Forum|alt.badge.img+11
  • Veeam Legend
  • 675 comments
  • May 26, 2025

nice guide m8 ​@Iams3le  great job. 😎


Iams3le
Forum|alt.badge.img+11
  • Author
  • Veeam Legend
  • 1511 comments
  • May 26, 2025
Chris.Childerhose wrote:
Iams3le wrote:
Chris.Childerhose wrote:

Great article on the PG upgrade. We can also add a fourth method if installed on Linux using the built in tool there as well. 👍

I agree! That is a potential blogpost when I get a new appliance for v13! 

Yeah not even the appliance for v13 just standard Linux with PG installed like Ubuntu as an example which I use.

Yes, I agree. But I do not have this environment :-)


Iams3le
Forum|alt.badge.img+11
  • Author
  • Veeam Legend
  • 1511 comments
  • May 26, 2025
Link State wrote:

nice guide m8 ​@Iams3le  great job. 😎

Cheers as always!!!


Iams3le
Forum|alt.badge.img+11
  • Author
  • Veeam Legend
  • 1511 comments
  • May 26, 2025
matheusgiovanini wrote:

Really great and comprehensive guide ​@Iams3le. Thanks for sharing.

You are welcome!


coolsport00
Forum|alt.badge.img+21
  • Veeam Legend
  • 4809 comments
  • May 27, 2025

Really enjoyed this article Christian. I like your last (3rd) Section… “or, if you like to over complicate things” 🤣🤣

Will save this for future use! Thanks for sharing.


Iams3le
Forum|alt.badge.img+11
  • Author
  • Veeam Legend
  • 1511 comments
  • May 27, 2025
coolsport00 wrote:

Really enjoyed this article Christian. I like your last (3rd) Section… “or, if you like to over complicate things” 🤣🤣

Will save this for future use! Thanks for sharing.

You are welcome!!!


Comment