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 1uPRVZ-0087Fn-3f for pgsql-general@arkaria.postgresql.org; Wed, 11 Jun 2025 19:53:13 +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 1uPRVX-0061IX-5n for pgsql-general@arkaria.postgresql.org; Wed, 11 Jun 2025 19:53:11 +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 1uPRVW-0061IO-Q2 for pgsql-general@lists.postgresql.org; Wed, 11 Jun 2025 19:53:11 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uPRVV-001Vo7-25 for pgsql-general@lists.postgresql.org; Wed, 11 Jun 2025 19:53:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=momjian.us; s=2025010100; h=In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-ID:Content-Description; bh=zxLd9xK5YmgddMfqQe/LcFf3IiUKN96X6yIUk5Ct3BU=; b=st6OLr3nPLclglNuXq36gypstk 9Lq1y3MacnCSee/jKVATtqz2f2zZjQZM/gqpnhFDmqE3p6mfcTaIqP9v4aJwHBJ2gzVTv6KWsfpsk fEkP6cfWYTT+BMOuIKP9htCQwi53XKgAgyo4RiQXyOBznFyWyAaI3qa9Z0akqt7H+1l9zV0skicoi W8Ci01vnDqZB0VihhD1DEmujCvDXPMnKAXXqaTHHO8DweT85Mvf6GewC8LyjuWCUBJGjGDtGrpLsD vjHi+XSotG5Z683HnwO+lHA6ibLnOG1TtaU2roz3m26jveFaT83h80ZKJiprrsCnxJUxpyAXMwefo Yw50m9FQ==; Received: from bruce by momjian.us with local (Exim 4.96) (envelope-from ) id 1uPRVT-009BvZ-25; Wed, 11 Jun 2025 15:53:07 -0400 Date: Wed, 11 Jun 2025 15:53:07 -0400 From: Bruce Momjian To: Jim Cunning Cc: Adrian Klaver , pgsql-general@lists.postgresql.org Subject: Re: pg_upgradecluster version 10 to 16 question Message-ID: References: <98182efc-eb12-42f0-8016-01163b5c6fcb@aklaver.com> <3183251c-4c06-490b-a0d7-8e2c6d0386e6@aklaver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Jun 11, 2025 at 11:59:24AM -0700, Jim Cunning wrote: > 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. Uh, newer vesions of pg_dump should be able to dump from a PG 10 cluster. --------------------------------------------------------------------------- > > 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. > > > > > > > -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com Do not let urgent matters crowd out time for investment in the future.