<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://t2bwiki.iihe.ac.be/index.php?action=history&amp;feed=atom&amp;title=TracBackup</id>
	<title>TracBackup - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://t2bwiki.iihe.ac.be/index.php?action=history&amp;feed=atom&amp;title=TracBackup"/>
	<link rel="alternate" type="text/html" href="https://t2bwiki.iihe.ac.be/index.php?title=TracBackup&amp;action=history"/>
	<updated>2026-04-20T23:48:02Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://t2bwiki.iihe.ac.be/index.php?title=TracBackup&amp;diff=296&amp;oldid=prev</id>
		<title>Maintenance script: Created page with &quot; == Trac Backup == TracGuideToc  Since Trac uses a database backend, some extra care is required to safely create a backup of a  project environment. L...&quot;</title>
		<link rel="alternate" type="text/html" href="https://t2bwiki.iihe.ac.be/index.php?title=TracBackup&amp;diff=296&amp;oldid=prev"/>
		<updated>2015-08-26T12:29:15Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot; == Trac Backup == &lt;a href=&quot;/index.php?title=TracGuideToc&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;TracGuideToc (page does not exist)&quot;&gt;TracGuideToc&lt;/a&gt;  Since Trac uses a database backend, some extra care is required to safely create a backup of a &lt;a href=&quot;/TracEnvironment&quot; title=&quot;TracEnvironment&quot;&gt; project environment&lt;/a&gt;. L...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
== Trac Backup ==&lt;br /&gt;
[[TracGuideToc]]&lt;br /&gt;
&lt;br /&gt;
Since Trac uses a database backend, some extra care is required to safely create a backup of a [[TracEnvironment| project environment]]. Luckily, [[TracAdmin| trac-admin]] has a command to make backups easier: &amp;lt;tt&amp;gt;hotcopy&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
  &amp;#039;&amp;#039;Note: Trac uses the &amp;lt;tt&amp;gt;hotcopy&amp;lt;/tt&amp;gt; nomenclature to match that of [http://subversion.tigris.org/ Subversion], to make it easier to remember when managing both Trac and Subversion servers.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
=== Creating a Backup ===&lt;br /&gt;
&lt;br /&gt;
To create a backup of a live TracEnvironment, simply run:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  $ trac-admin /path/to/projenv hotcopy /path/to/backupdir&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[TracAdmin| trac-admin]] will lock the database while copying.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The resulting backup directory is safe to handle using standard file-based backup tools like &amp;lt;tt&amp;gt;tar&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;dump&amp;lt;/tt&amp;gt;/&amp;lt;tt&amp;gt;restore&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Please, note, that hotcopy command does not overwrite target directory and when such exists, hotcopy ends with error: &amp;lt;tt&amp;gt;Command failed: [Errno 17] File exists:&amp;lt;/tt&amp;gt; This is discussed in [trac:ticket:3198 #3198].&lt;br /&gt;
&lt;br /&gt;
==== Restoring a Backup ====&lt;br /&gt;
&lt;br /&gt;
Backups are simply a copied snapshot of the entire [[TracEnvironment| project environment]] directory, including the SQLite database. &lt;br /&gt;
&lt;br /&gt;
To restore an environment from a backup, stop the process running Trac (i.e. the Web server or [[TracStandalone| tracd]]), restore the contents of your backup (path/to/backupdir) to your [[TracEnvironment| project environment]] directory and restart the service.&lt;br /&gt;
&lt;br /&gt;
  &amp;#039;&amp;#039;Note: Automatic backup of environments that don&amp;#039;t use SQLite as database backend is not supported at this time. As a workaround, we recommend that you stop the server, copy the environment directory, and make a backup of the database using whatever mechanism is provided by the database system.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
See also: TracAdmin, TracEnvironment, TracGuide, [trac:TracMigrate TracMigrate]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{TracNotice|{{PAGENAME}}}}&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>