简体   繁体   English

将远程Postgresql 9.1数据库迁移到本地Postgresql 11

[英]migrating remote postgresql 9.1 database to local postgresql 11

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. 我想将postgresql 9.1数据库升级到postgresql11。首先,我想使用pg_dump从pg11服务器获取远程pg9.1服务器上的数据以进行实验。 How do I copy the database on the remote server to the new server with the new pg_dump. 如何使用新的pg_dump将远程服务器上的数据库复制到新服务器上。

The following code is using old pg_dump and it doesn't work. 以下代码正在使用旧的pg_dump,因此无法正常工作。

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

pg11 on the network connected to the old database by taking full dump I solved 通过完全转储连接到旧数据库的网络上的pg11我解决了

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM