upgrade to postgres 14 from postgres 13 using pg_basebackup

Posted on

Question :

I want to upgrade/move a running timescale cluster manage by Patroni using PostgreSQL 13 to a new hardware with PostgreSQL 14, the dataset is ~ 40GB but is taking ages take a backup using:

pg_dump -j 8 -Fd -f /tmp/promscale.back -v promscale

Same if using ts-dump

Therefore wondering if I could use pg_basebackup? Currently I am trying something like:

pb_basebackup -h 10.1.2.3 -U replicator -P -D /db/data14 -S slot1 -X stream --checkpoint=fast

But I only get this and no progress:

waiting for checkpoint

Any idea about how could I speed the dump or upgrade with the minimum zero downtime?

Answer :

You cannot use pg_basebackup to upgrade. You have to use pg_upgrade. Have you tried reading the documentation?

From the manual:

At the beginning of the backup, a checkpoint needs to be performed on the source server. This can take some time (especially if the option –checkpoint=fast is not used), during which pg_basebackup will appear to be idle.

Leave a Reply

Your email address will not be published. Required fields are marked *