trac-ticketlinks / wiki-default / TracBackup

= Trac Backup =
Since Trac uses a database backend, it requires some extra care to safely create a backup of a TracEnvironment. Luckily, TracAdmin 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.

== Creating a Backup ==
To create a backup of a live TracEnvironment, simply run:
  $ trac-admin /some/where/mytracenv hotcopy /my/vault/mytracenv-backup

'''Note:''' TracAdmin will lock the database while copying.

The resulting backup copy is safe to handle using standard file-based backup tools like tar or dump/restore.

=== Restoring a Backup ===
Backups are simply a copied snapshot of the entire TracEnvironment directory structure, including the SQLite database. 

To restore an environment from a backup, simply shut down your Trac service (Web server or tracd), restore the directory structure from backup and restart the service.

See also: TracAdmin, TracGuide
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.