migrating remote postgresql 9.1 database to local postgresql 11

215 Views Asked by At

I want to upgrade the postgresql 9.1 database to postgresql 11. First I want to get the data on the remote pg9.1 server with pg_dump from the pg11 server to make an experiment. How do I copy the database on the remote server to the new server with the new pg_dump.

The following code is using old pg_dump and it doesn't work.

ssh user @ remote_machine "pg_dump -U dbuser -h localhost -C --column-inserts" \ >> backup_file_on_your_local_machine.sql

1

There are 1 best solutions below

0
On BEST ANSWER

pg11 on the network connected to the old database by taking full dump I solved

pg_dumpall -U postgres -h 10.100.80.100 -p 5432 --clean --file=/pg11localstoragepath/backup/mydb_backup.dump