Monday, January 2, 2023

Copy Postgresql database to another server

 Notes for Postgresql 11,12

This approach allows an SQL file to be copied to a destination server and install using that sql file.

On the source server

pg_dump -C -Fp -f dump.sql -U postgres database_name


Copy the file dump.sql to the destination server. On the destination server

psql -U postgres -f dump.sql


No comments:

Blog Archive