| From: | Ron Johnson <ronljohnsonjr(at)gmail(dot)com> |
|---|---|
| To: | pgsql-general <pgsql-general(at)postgresql(dot)org> |
| Subject: | Re: Upgrading 6 versions between 2 systems |
| Date: | 2026-09-15 02:33:19 |
| Message-ID: | CANzqJaDvonhT5_6g7XNa192R3221NB5SXaa=BudpkrRSQOHtzA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
If you're upgrading to a new PC instead of upgrading Slackware and PG on an
existing PC, then something like this will work from the new system:
pg_dumpall -g --host=old_pc | psql -d postgres
for db in x, y, z; do
pg_dump --host=old_pc -Fp $db | psql $db
done
(I might be missing some required options, since I don't do this
very often.)
On Mon, Sep 14, 2026 at 5:44 PM Rich Shepard <rshepard(at)appl-ecosys(dot)com>
wrote:
> 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
>
>
>
--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Alban Hertroys | 2026-09-15 08:02:13 | Re: Upgrading 6 versions between 2 systems |
| Previous Message | Brajendra Pratap Singh | 2026-09-15 01:38:35 | pg_upgrade --link |