How to Dump a Remote PostgreSQL Database and Restore to Local Database

Öncelikle uzak veritabanından binary dump almak için;
pg_dump -h [RemoteIPAdresi] -Fc -o -U [DBKullaniciAdi] [VeritabaniAdi] > [OutputDosyaAdi]
Örnek; pg_dump -h 123.123.123.234 -Fc -o -U postgres postgres > dbdump.sql
Daha sonra dump'yi local veritabanına import etmek için;
sudo -u postgres pg_restore -d [VeritabaniAdi] [DumpDosyasi]
Örnek; sudo -u postgres pg_restore -d postgres dbdump.sql

Yorumlar