Overview

PostgreSQL's latest major version is 12. That being said, it is fairly easy to migrate between versions even major ones. There are couple ways to upgrade, depending on how much you want to risk to compromise with. Practically there are 2 ways of Upgrade in any database:

In-Place: You upgrade on the same host

Out-Of-Place: You upgrade using 2nd host, most often via Replication or data migration directly to the new release.

We will discuss both methods in this section. So let's get started:

In-Place

Important to note here is that even the In-place upgrade isn't so risky as with other databases (Oracle / SQL / DB2 and so on). The steps to perform In-Place upgrade in PostgreSQL between major version are pretty straight-forward. So let's get going: In this case, we will also, upgrade from 9.6 → 10.

Install the new Release

You can install the new version by either compiling the source or using package manager (in my case yum).

The new version, will come in it's own binary and data locations:

Create Database base

After that, we have to create a database base:

It is very good idea to check for possible compatability problems between the two versions in order to play it safe: