Re: pg_upgrade 13.6 to 15.1? - Mailing list pgsql-general

From Tom Lane
Subject Re: pg_upgrade 13.6 to 15.1?
Date
Msg-id 1693377.1673816360@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_upgrade 13.6 to 15.1?  (pf@pfortin.com)
Responses Re: pg_upgrade 13.6 to 15.1?  (pf@pfortin.com)
List pgsql-general
pf@pfortin.com writes:
> On Sun, 15 Jan 2023 14:47:35 -0500 Tom Lane wrote:
>> 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?

Yes, but to use --link you must have both data directories on the
same filesystem, so this is still the wrong thing.

Try something like

    mv /mnt/work/var/lib/pgsql/data /mnt/work/var/lib/pgsql/data13
    initdb /mnt/work/var/lib/pgsql/data
    pg_upgrade ... -d /mnt/work/var/lib/pgsql/data13 -D /mnt/work/var/lib/pgsql/data --link ...

            regards, tom lane



pgsql-general by date:

Previous
From: pf@pfortin.com
Date:
Subject: Re: pg_upgrade 13.6 to 15.1?
Next
From: Adrian Klaver
Date:
Subject: Re: pg_upgrade 13.6 to 15.1?