How it works…

The early portion of this recipe focuses on initializing a new cluster using initdb with the target version of PostgreSQL we want to upgrade to. For the purposes of demonstration in this recipe, we used version 11.

As usual when performing this kind of bootstrap, we copy all of the configuration files from the origin node. In this case, we want at least the postgresql.conf and pg_hba.conf files, as they define the majority of our configuration settings and connection access definitions. If your cluster uses the postgresql.conf include_dir directive, copy the full contents of any of those locations as well. It's important to capture as much of the original cluster structure as we can.

Don't forget to examine the postgresql.conf ...

Get PostgreSQL 12 High Availability Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.