[rt-users] BACKING UP RT WITH POSTGRES

Kevin Murphy murphy at genome.chop.edu
Tue Dec 19 10:19:14 EST 2006


Kurt A. Brust wrote:
> What is the best way to do this? also what should be backed up?
>   
Just use pg_dump to create a self-consistent snapshot of the database.  
Hopefully you have some general backup scheme to back up your systems, 
which will safeguard your RT customizations (RT_SiteConfig.pm at a 
minimum) as well as the database snapshot you create.

E.g., I have a crontab for the 'postgres' superuser, which backs up my 
RT database (called rt3) to a single compressed SQL file:

# Do a dump every day at 6:45pm
45 18 * * * /usr/local/pgsql/bin/pg_dump rt3 | gzip -c 
 >/usr/local/pgsql/dumps/rt3.daily.dump.gz

This dump can be slurped right into psql to restore the database if 
needed: gunzip -c rt3.daily.dump.gz | psql

You could also use the 'custom' option on pg_dump, which can be used in 
concert with the pg_restore utility for greater flexibility.

See the man page for pg_dump.

When you do major postgresql version upgrades, you need to do 
dumps/restores, so it's good to know how to do this.

-Kevin Murphy




More information about the rt-users mailing list