Reputation: 369
I am migrating my postgres 9.3 to 9.4 and for that i need to take backup of existing DB, so I am confused in 2 pg_basebackup and pg_dumpall.
I am new to postgres, and help or suggestion will be very helpful.
Upvotes: 2
Views: 1344
Reputation: 324751
pg_basebackup
won't work, since 9.4 can't start from a 9.3 data directory.
Your options are:
pg_dumpall
. Simplest.
pg_upgrade
. Lowest downtime, but trickier.
pg_dumpall --globals-only
, then pg_dump -Fc
each database and restore with psql
for the globals then pg_restore
for each database. This approach is more flexible, and is what I generally use for backups.
Upvotes: 1