<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect1 SYSTEM "../../../dtd/dblite.dtd">
<sect1 id="tsvn-repository-backup">
	<title>Repository Backup</title>
	<indexterm>
		<primary>backup</primary>
	</indexterm>
	<para>
		Whichever type of repository you use, it is vitally important
		that you maintain regular backups, and that you verify the
		backup. If the server fails, you may be able to access a
		recent version of your files, but without the repository
		all your history is lost forever.
	</para>
	<para>
		The simplest (but not recommended) way is just to copy the
		repository folder onto the backup medium. However, you have
		to be absolutely sure that no process is accessing the data.
		In this context, access means <emphasis>any</emphasis>
		access at all. A BDB repository is written to even when
		the operation only appears to require reading, such as getting
		status. If your repository is accessed at all during the copy,
		(web browser left open, WebSVN, etc.) the backup will be worthless. 
	</para>
	<para>
		The recommended method is to run
<screen>
svnadmin hotcopy path/to/repository path/to/backup --clean-logs
</screen>
		to create a copy of your repository in a safe manner. Then backup
		the copy. The <literal>--clean-logs</literal> option is not
		required, but removes any redundant log files when you backup
		a BDB repository, which may save some space.
	</para>
	<para>
		The <literal>svnadmin</literal> tool is installed automatically
		when you install the Git command line client. If you
		are installing the command line tools on a Windows PC, the
		best way is to download the Windows installer version. It
		is compressed more efficiently than the <filename>.zip</filename>
		version, so the download is smaller, and it takes care of setting
		the paths for you. You can download the latest version of the
		Git command line client from
		<ulink url="http://Git.tigris.org/servlets/ProjectDocumentList?folderID=91">
			<citetitle>http://Git.tigris.org/servlets/ProjectDocumentList?folderID=91</citetitle>
		</ulink>.
	</para>
</sect1>
