Re: Upgrading 6 versions between 2 systems

From: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Upgrading 6 versions between 2 systems
Date: 2026-09-14 21:44:20
Message-ID: 8598df-508d-fa22-5866-35423256b1b3@appl-ecosys.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 14 Sep 2026, Ron Johnson wrote:

> Yes. Note, though, that a single .sql file is the *slow* way to
> export/import a database, especially if it's of any size.

Ron,

My databases are small and I'll transfer them one-at-a-time rather than the
whole custer itself.

> Multithreaded export import is faster. Something like this is what I'd do:
>
> Current system:
> cd /path/to/backups
> pg_dumpall --globals-only > globals_127.sql
> Zlvl="--compress=zstd"
> Threads=4 # or whatever
> for db in x, y, z; do
> pg_dump -p5432 -Fd $Zlvl -v --jobs=$Threads -f $db $db
> done
>
> New system:
> cd /path/to/backups
> psql -af globals_127.sql
> Zlvl="--compress=zstd"
> Threads=4 # or whatever
> for db in x, y, z; do
> ${pg18}/pg_restore -p5433 -v --jobs=$Threads --clean --create -Fd -d
> postgres $db
> done

Good idea.

Thanks,

Rich

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2026-09-14 21:55:02 Re: Upgrading 6 versions between 2 systems
Previous Message Rich Shepard 2026-09-14 21:39:00 Re: Upgrading 6 versions between 2 systems