12

We use separate TRAC instances as our ticket system for many projects and need to have them moved off site several times a day for disaster recovery.

What is the best way to make this happen? Is there something similar to svnsync for subversion?

4 Answers 4

8

To fully recover trac environment you need following things:

  • backup DB;
  • backup configuration files;
  • backup wiki files (html and attachments);
  • backup password files if you're using htpasswd auth;
  • optional plugins (even though this are available for download, I'd backup them for quicker recovery);

In case of the standard setup (with SQLite as BD backend), this means that all you have to backup are the contents of the trac install dir.

Also it would be useful to create list of all Python packages you need to install with easy_install.

6

I've used a script to safely backup both SVN + the full Trac instance into a .tar.gz file. From there, it can be backed up as usual with the other files..

#!/bin/sh

DATE=`date +%F-%H%M%S`
nice svnadmin dump /var/svn/trac.example.com > dump.$DATE.svn
nice trac-admin trac.example.com hotcopy trac.example.com-$DATE.trac

# take the SVN dump, and trac hotcopy, put into a dated TGZ anc copy to /backup...    
nice tar czf svn-trac.$DATE.tar.gz  backupTrac.sh startTracd.sh trac.htdigest \
           trac.example.com-$DATE.trac dump.$DATE.svn && \
   cp svn-trac.$DATE.tar.gz /backup/trac/ &&
   rm -rf trac.example.com-$DATE.trac dump.$DATE.svn
2
  • Remember that some sort of binary diff can really reduce the size between backups. The only downside is if you lose the initial or one of the intermediate diffs.
    – Joshua
    Jul 26, 2009 at 19:47
  • 1
    For a backup, I'd rather play very, very, safe. Diskspace is cheap, having problems recovering a backup is not. Jul 26, 2009 at 19:58
5

You might want to take a look at TracBackup:

Since Trac uses a database backend, some extra care is required to safely create a backup of a project environment. Luckily, trac-admin has a command to make backups easier: hotcopy.

Note: Trac uses the hotcopy nomenclature to match that of Subversion, to make it easier to remember when managing both Trac and Subversion servers.

0

If you are using sqlite as backend (default setting), you could just hotcopy the file. The filesize (at least for us) is so small, that we never had problems with its consistency.

1
  • How are you backing up and restoring ticket attachments?
    – a coder
    May 30, 2017 at 18:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .