dump and restore postgresql

dump (backup your postgresql) i am backup my database called google into a file called google.sql

./pg_dump -i -h localhost -p 5432 -U google -F c -b -v -f google.sql google

now i am moving that to another server using scp or rsync, then restore it

cat google.sql | pgsql -U google_user google_restore

google.sql adalah nama file backup
google_user adalah nama user database postgresql kamu
google_restore adalah nama schema database kamu

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s