Jaime Frutos Morales's blog


Create and restore Trac backups

Filed under: SysAdmin — acidborg @ 14:03

Since Trac uses a database backend (SQLite by default), you can’t just copy its files to make a backup. The tool trac-admin includes an option to do this.

To create a Trac backup: trac-admin /path_to_trac_environment hotcopy /path_to_backup_directory

It will lock the database and make a live copy of your Trac environment to the specified directory. It must NOT exist, otherwise an error will appear (Command failed: [Errno 17] File exists). Once you have made this live copy, you can create a backup of this directory using your favourite backup system.

To restore a Trac backup: stop the process running Trac (usually Apache), copy the content of the backup directory to your Trac environment and restart the process you use to run Trac.

Blog at WordPress.com.

%d bloggers like this: