How to backup Your postgresql


How to backup your db postgres

Langkah 1 :

1. Login ke server database , kemudian masuk sebagai root
:~$ sudo su

2. Ada 2 extension file untuk backup database
1. sql = sudah pasti untuk file sql
2. bac = untuk file backup

3. Perintah untuk backup database
Pg_dump –U |user| –h |host| |database| –t |table| -> namafilebaru.extension
Example :
# Pg_dump –U mutiara –h 10.8.8.146 smsok –t inbox -> inbox2010.sql

4. Proses backup selesai.

Langkah 2 :

1. Extrak file sql

2. Perintah untuk extrak file adalah :
tar –cvzf |namafileextrak|tar.gz |directoryfile|
Example :
# tar –cvzf inbox2010.tar.gz /home/mutiara

3. Proses extrak file selesai.
Langkah 3 :
1. Copy file backup yang sudah di extrak ke server backup
2. Kita gunakan perintah SCP
Scp namefile user@server : dir diserverbackup
Example :
# scp smsok2010.tar.gz mutiara@10.8.8.200 : /home/backup
3. Proses copy file backup selesai.

Proses backup database postgres selesai😀

#ditulis supaya gak lupa lagi😀

About Mutiara Satiri
I am a big fans of THE BIG REDS , and I am a Power rangers :))

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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: