如何在PgSQL中将数据库从一个服务器移动到另一个服务器? [英] How do I move a database from one server to another in PgSQL?
本文介绍了如何在PgSQL中将数据库从一个服务器移动到另一个服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试将数据库从旧服务器移动到新服务器。任何帮助将不胜感激。
I am trying to move a database from my old server to a new server. Any help would be appreciated.
推荐答案
只是 pipe 从旧服务器转储到新服务器:
Just pipe a dump from the old server into the new one:
pg_dump -h 172.26.76.100 -p 5432 -U username your_db | psql -h localhost -p 5432 -U username your_db
替换ip地址,你去。如果您使用的是不同版本的PostgreSQL,请务必使用最新版本的 pg_dump 和 psql 。
Replace the ip addresses and there you go. If you're using different versions of PostgreSQL, make sure you use pg_dump and psql from the latest version.
这篇关于如何在PgSQL中将数据库从一个服务器移动到另一个服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文