Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Ok, I'm quite new to this server administration stuff. I have set up an ec2 instance running my website. I'm running everything on a single machine - node.js & postgres. What is the best way to backup my postgres db?

Thanks for your h

share|improve this question

2 Answers 2

up vote 1 down vote accepted

One of the easiest and recommended ways is to use *pg_dump*. It makes consistent backups even if the database is being used concurrently.

Script *pg_dump* to offload dumps to S3 bucket. Setup the script to be run using crontab on a hourly basis.

share|improve this answer
    
how do you get pg_dump to offload dumps to s3? –  dan May 23 '12 at 17:07
    
Have pg_dump dump the backup sql. Use scripts like s3curl.pl ( aws.amazon.com/code/128 ) or s3cmd ( s3tools.org/s3cmd ) to push the dump to S3 bucket. –  Shyam Sundar C S May 23 '12 at 17:10

You can use pgAdmin to backup your databases:

http://www.pgadmin.org/

It's very easy. Login to localhost or hostname if remote. After setting up your connection in pgAdmin, goto Server Groups->Servers->PostgreSQL 9.0 (localhost:5432)->database. Drop-down menu and select backup. Enter filename. Hit OK. Backup done.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.