Backing up rt with postgres

What is the best way to do this? also what should be backed up?

thanks

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

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