RE: [rt-users] BACKING UP RT WITH POSTGRES

2006-12-19 Thread Scott Golby
> What is the best way to do this? also what should be backed up?

I'm doing a Dump of the DB
/usr/bin/pg_dump rt3 > /root/backups/rt3-db-$TODAY_DATE.sql

Then running tar and picking up that file, the whole of /opt/rt3 and
rolling them into one package.  You might also want to pick up the
Apache config if you're not back it up elsewhere.

- Scott

___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com


Re: [rt-users] BACKING UP RT WITH POSTGRES

2006-12-19 Thread Kevin Murphy

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

___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com