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.

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?

share|improve this question
add comment

4 Answers 4

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.

share|improve this answer
add comment

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
share|improve this answer
    
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 '09 at 19:47
    
For a backup, I'd rather play very, very, safe. Diskspace is cheap, having problems recovering a backup is not. –  Alister Bulman Jul 26 '09 at 19:58
add comment

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

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.