Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Copy Database to another Server in Windows (pg_dump – backup & restore)

In our organization, junior database developers are learning PostgreSQL, and they require a sample database from our Validation Database Server.

In this scenario, Database Administrator takes PostgreSQL backup using pg_dump utility and restore that dump into the development environment.

A pg_dump is a PostgreSQL utility which is used for PostgreSQL database backup and restore.

Another option is, directly copy the database from one server to another server using pg_dump + psql. In this scenario, Database Administrator does not require any intermediate database backup file.

Open your windows command prompt and go to \PostgreSQL\bin directory where you can execute and test below two different commands.
Copy database from one server to another server (using, pg_dump | psql):
pg_dump -h host1 dbname | psql -h host2 dbname
Copy database, Using pg_dump utility for backup and restore:
Take full database backup:
pg_dump -U username database_name > filepath\backup.sql
Restore database backup:
pg_dump -U username database_name < filepath\backup.sql

Comments

Popular posts from this blog

VMWARE WORKSTATION 3,4,5,6,7,8,9,10,11,12,14,15...etc LICENSE KEYS COLLECTION

Top 10 Highest Paying URL Shortener Companies - Best URL Shorteners To Earn Fast

How to find the server is whether standby (slave) or primary(master) in Postgresql replication ?

rman interview and scenario based questions and answer and also rman(backup and recovery) discussions panel

aireplay-ng