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


Reply via email to