Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pHAhi-0003IY-LB for pgsql-general@arkaria.postgresql.org; Sun, 15 Jan 2023 21:38:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pHAhh-0000qI-1F for pgsql-general@arkaria.postgresql.org; Sun, 15 Jan 2023 21:38:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pHAhg-0000q9-I1 for pgsql-general@lists.postgresql.org; Sun, 15 Jan 2023 21:38:12 +0000 Received: from rs6162.luxsci.com ([162.142.76.255]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pHAhe-00081o-Fv for pgsql-general@lists.postgresql.org; Sun, 15 Jan 2023 21:38:11 +0000 Received: from pfortin.com (h163.145.185.173.dynamic.ip.windstream.net [173.185.145.163]) (authenticated bits=0) by rs6162.luxsci.com (8.15.2/8.14.9) with ESMTPSA id 30FLc8jp942336 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Sun, 15 Jan 2023 21:38:09 GMT Date: Sun, 15 Jan 2023 16:38:08 -0500 From: pf@pfortin.com To: pgsql-general@lists.postgresql.org Subject: Re: pg_upgrade 13.6 to 15.1? Message-ID: <20230115163808.22072dfc@pfortin.com> In-Reply-To: <1693377.1673816360@sss.pgh.pa.us> References: <20230115142732.0ec38e2a.pfortin@pfortin.com> <1650559.1673812055@sss.pgh.pa.us> <20230115153919.6d21ea50@pfortin.com> <1693377.1673816360@sss.pgh.pa.us> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.36; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Lux-Comment: Message 30FLc8jp942336 sent by user #22429 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pfortin.com; h=date:from:to:subject:message-id:in-reply-to:references:mime-version:content-type:content-transfer-encoding; s=dkim; bh=p5CmVxf6zLgez4QqJuZvIpkHBldepNG1OO8GT8gLsxM=; b=fjCvDQ2wgQbON8tex7fOAa7afwpKrGCsrtPAyx4OxVHwc/Dqp6y5zQoyI9pNZuWj4o3TWjNomaBI8kePcc517bo6W8NjYgFZrYJe+RUBhLJlFEM7hZ3bOMjeceA92TRvemsldEsMVRncPU/KM7Q6oshT7m9qpCfx3xyyV5F98DQ= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, 15 Jan 2023 15:59:20 -0500 Tom Lane wrote: >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 My understanding: > mv /mnt/work/var/lib/pgsql/data /mnt/work/var/lib/pgsql/data13 - renames the DB > initdb /mnt/work/var/lib/pgsql/data - creates new DB > pg_upgrade ... -d /mnt/work/var/lib/pgsql/data13 -D /mnt/work/var/lib/pgsql/data --link ... - if this only creates hard links; then this should do what I want. My big concern was due to the DB being about 65% of /mnt/work; so doing it on the same file system absolutely requires hard links vs copying... Looks like this is what I was trying to be certain of... Thanks!! Pierre > regards, tom lane > > >