Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uPQfd-007ndx-R9 for pgsql-general@arkaria.postgresql.org; Wed, 11 Jun 2025 18:59:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uPQfb-005Uwh-IB for pgsql-general@arkaria.postgresql.org; Wed, 11 Jun 2025 18:59:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uPQfb-005UwZ-7K for pgsql-general@lists.postgresql.org; Wed, 11 Jun 2025 18:59:31 +0000 Received: from mail-yw1-x112e.google.com ([2607:f8b0:4864:20::112e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uPQfa-001VPe-0k for pgsql-general@lists.postgresql.org; Wed, 11 Jun 2025 18:59:31 +0000 Received: by mail-yw1-x112e.google.com with SMTP id 00721157ae682-7111d02c777so890087b3.3 for ; Wed, 11 Jun 2025 11:59:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749668366; x=1750273166; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:content-language:from :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=ciKH7UsCzhoQR7y89lZBVzajRgPdZ330YYOGdoptwQs=; b=h8CddXZOdrqFbB+McNSyeFL1aj9MsiQbymfj6x4LKWxs7niYc4pFCSUnrIVZDim4uw 9QJwnTxbebQL7jhz7B87cBsjqZEsMyd9u6BbqAiypbj4x4oPQ97XG7k0VLgpZTeKiQOr moo8cNE9mhen8UuuThRBjiikXgWcX4QY3/xhxhS14B10VnzvnKbNgqE8cOzVY9ajaC9D oPp6N6/3/rzx8a1z1/8WiyJNsXN/dAhjxCtEXy6RXcvT3qiWATBo168W/LtAKoaEtCXm jz0quDssc9olBHWBbKwFSLVv0J17DBSHb4+WsJUi2bAnmLne2Nx3zLupj8Ni3dDjQHah 2rEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749668366; x=1750273166; h=content-transfer-encoding:in-reply-to:content-language:from :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ciKH7UsCzhoQR7y89lZBVzajRgPdZ330YYOGdoptwQs=; b=Am0xQmq3Synpw+yMXbS1d9vq5TapUX+UVmdejwQDKiYAfRJAvM69NyTi5u6N7s0ru0 JZNqJtf0FxuZeVXxcUEzXvlDZsYCXJDYZIrFLAfRSeS60NbEuGs24rWnWZCpXYNsZ/Tr EcpZT2NQZMdLCrTBmrWEaR0ocY+XYS+lb7dk9WYxOxVC098MoJXWIviPpsbJ+A74qj0u oHSGm9hkct2u0Q+gu8ATaKahLNLrcePmZophvF8Qo5hTdYEMQKT3jt9VfaLY1RcGgVWk 1Vl0RR2Z+FetJxlW7o/y3S0LX1h29xgejgQy0nJW2k65B5FFtcMhFpbbRp7VFFYLEGun ptwg== X-Forwarded-Encrypted: i=1; AJvYcCWu8kK1DPawjhGoppqx1M3RwBB/FppvZ2fNnzwI9vykU2l/IlEyA1RCcR6Ng7S1QUzu3nnuyQ7vZsksj5kI@lists.postgresql.org X-Gm-Message-State: AOJu0YzFyGZmkDQGh2ZZ2y/4zuOIbomRzk/8SrP9Wh+YVJdp7lfeVGbg T5GjXyTusQhvSNz0h/r5isVTilXj+tLBfUiWvQczduNaFmlwWi6PaVA6GC0FNv2p X-Gm-Gg: ASbGncuoY/AINXPYCdeaB7dzHpWUIfVt71aFtJSUy3OO0VRfIaHmaJrJAc/BNi2rV13 aSIYNNCgdM6J+0LZJfYIcwpsPFdH8VTsQTAa+8rfouW2YgbUEq33+xjBE4bfWStJkEBcV/g3OoP rnKB1ypnjJmFc3Ly3k6jgJ88buiwWQltUGVIFtkTdAFSaj0l2kpWZR6fX1iHwhhXFg6uY35hR09 eZX0FV8EvX71fMhJQTmXJbw7s7RQXwAyIAGi/E0YZBPGQEyu8zOAIU9pR4t5X4MqtGeKmAGaupa /3LE+OLdF20mftEFw1mwjvZnnzqdhGJ3UVijETt65/gwig+NnhzNP23xzm0KyopxoapMBihBFYV oO2tWgKDtdffAriuPIJM+h0OijkYJG9BHlbnQdg6uD1J0ziPaIGggBvmS X-Google-Smtp-Source: AGHT+IFyxsvrEv+4ytldFfwem/hvadNLJUfNCnDxCJ7cXNdkhdY6GY3XbRmkb+LNPHGf2iDRqKLaUw== X-Received: by 2002:a05:690c:25c3:b0:70e:142d:9c4e with SMTP id 00721157ae682-71150b98dc1mr4264827b3.26.1749668366363; Wed, 11 Jun 2025 11:59:26 -0700 (PDT) Received: from [10.168.1.252] (99-121-248-144.lightspeed.sndgca.sbcglobal.net. [99.121.248.144]) by smtp.gmail.com with ESMTPSA id 00721157ae682-71151597df4sm15357b3.31.2025.06.11.11.59.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Jun 2025 11:59:25 -0700 (PDT) Message-ID: Date: Wed, 11 Jun 2025 11:59:24 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: pg_upgradecluster version 10 to 16 question To: Adrian Klaver , pgsql-general@lists.postgresql.org References: <98182efc-eb12-42f0-8016-01163b5c6fcb@aklaver.com> <3183251c-4c06-490b-a0d7-8e2c6d0386e6@aklaver.com> From: Jim Cunning Content-Language: en-US In-Reply-To: <3183251c-4c06-490b-a0d7-8e2c6d0386e6@aklaver.com> Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I configured the PGDG repository and tried to install postgresql-10 on my kubuntu 24.04 LTS desktop system, but apt refused to install it because of unsatisfied dependencies.  I then installed kubuntu 22.04 LTS on a backup system and was able to install postgresql-10 there.  I was able to use pg_dump to recover all the data and move it to the replacement server running ubuntu 24.04 LTS with postgresql-16.  All should be good.  Thanks for the help.

On 6/10/25 13:17, Adrian Klaver wrote:
On 6/10/25 13:14, Adrian Klaver wrote:
On 6/10/25 13:01, Jim Cunning wrote:
I had a Ubuntu 20.04 LTS system with a postgresql version 10 database, and the system became unbootable.  The database was stored in /var/lib/postgresql/10/main and I was able to recover the entire contents of the data in that directory and below.  I now have a system running ubuntu 24.04 LTS with postgresql version 16.

I obviously no longer have a running version 10 server, so I cannot use pg_dump to retrieve the data.  I have placed the recovered version files in /var/lib/postgresql/10/main on my new system, alongside the /var/lib/postgresql/16/main that was created when I installed postgresql.  I have tried several iterations of the pg_upgradecluster command, a Python script provided by Ubuntu, but it says it cannot find the database files.

I also see from the postgresql wiki pages that there is a pg_upgrade utility program, but cannot find in any of the Ubuntu-provided installation files.  Can anyone provide some guidance on how I might proceed?

1) Do:

man pg_upgradecluster

2) Assuming you used the PGDG repos to install Postgres you can do:

sudo apt install postgresql-10

to get a Postgres 10 install. I would move the /var/lib/postgresql/10/main you created out of the way and then move the contents back in to the installed version.

Forgot to say, be sure and retain a copy of the original 10 $DATADIR somewhere where you can fetch it should the above not work as planned.



Thanks in advance.