Re: pg_upgrade 13.6 to 15.1?

From: pf(at)pfortin(dot)com
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: pg_upgrade 13.6 to 15.1?
Date: 2023-01-15 20:39:19
Message-ID: 20230115153919.6d21ea50@pfortin.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, 15 Jan 2023 14:47:35 -0500 Tom Lane wrote:

>pf(at)pfortin(dot)com writes:
>> Trying to upgrade from 13.6 to 15.1, pg_upgrade complains with:
>> [postgres(at)pf ~]$ /usr/bin/pg_upgrade -b /usr/local/pgsql/bin -B /usr/bin \
>> -d /mnt/db/var/lib/pgsql/data -D /mnt/work/var/lib/pgsql/data \
>> -s /tmp -U postgres
>
>> This utility can only upgrade to PostgreSQL version 15. <=====<<< ??
>
>This indicates that it thinks the new data directory (-D) is the
>wrong version. Perhaps the error message could be clearer about that.
>
>> Due to the database size, I have the working copy on a 4TB NVMe SSD
>> mounted at /mnt/work/var/lib/{pgadmin,pgsql} and an identical copy on an
>> 18TB platter at /mnt/db/var/lib/{pgadmin,pgsql}. Both copies are
>> currently at 13.6.
>
>I think you misunderstand how this is supposed to work. The -D
>argument should point at an *empty* data directory that has been
>freshly initialized with the new version's initdb. pg_upgrade then
>transfers data into that from the old database (-d argument).

I was hoping to avoid the hours worth of copying to the NVMe SSD.
The instructions refer to upgrading with --link; would that save the copy
time? I have an identical copy of the DB, so could recover if necessary
or just go the initdb route. I wasn't clear on the exact syntax for
including --link... if that's an option I can use, do I eliminate one of
the -d or -D parameters?

Thanks!
> regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message pf 2023-01-15 20:41:39 Re: pg_upgrade 13.6 to 15.1?
Previous Message Adrian Klaver 2023-01-15 20:23:10 Re: pg_upgrade 13.6 to 15.1?