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?
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community
To fully recover trac environment you need following things:
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
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
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.
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.