<div id="Backing-up"></div>
<div class="header">
<p>
Next: [[cvs: Moving a repository#Moving a repository|Moving a repository]], Previous: [[cvs: Creating a repository#Creating a repository|Creating a repository]], Up: [[cvs: The Repository#The Repository|Repository]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>

----

<div id="Backing-up-a-repository"></div>
=== Backing up a repository ===
<div id="index-Repository_002c-backing-up"></div>
<div id="index-Backing-up_002c-repository"></div>

There is nothing particularly magical about the files
in the repository; for the most part it is possible to
back them up just like any other files.  However, there
are a few issues to consider.

<div id="index-Locks_002c-cvs_002c-and-backups"></div>
<div id="index-_0023cvs_002erfl_002c-and-backups"></div>
The first is that to be paranoid, one should either not
use <small>CVS</small> during the backup, or have the backup
program lock <small>CVS</small> while doing the backup.  To not
use <small>CVS</small>, you might forbid logins to machines which
can access the repository, turn off your <small>CVS</small>
server, or similar mechanisms.  The details would
depend on your operating system and how you have
<small>CVS</small> set up.  To lock <small>CVS</small>, you would create
&lsquo;<tt>#cvs.rfl</tt>&rsquo; locks in each repository directory.
See [[cvs: Several developers simultaneously attempting to run CVS#Several developers simultaneously attempting to run CVS|Concurrency]], for more on <small>CVS</small> locks.
Having said all this, if you just back up without any
of these precautions, the results are unlikely to be
particularly dire.  Restoring from backup, the
repository might be in an inconsistent state, but this
would not be particularly hard to fix manually.

When you restore a repository from backup, assuming
that changes in the repository were made after the time
of the backup, working directories which were not
affected by the failure may refer to revisions which no
longer exist in the repository.  Trying to run <small>CVS</small>
in such directories will typically produce an error
message.  One way to get those changes back into the
repository is as follows:


* Get a new working directory.


* Copy the files from the working directory from before the failure over to the new working directory (do not copy the contents of the &lsquo;<tt>CVS</tt>&rsquo; directories, of course).


* Working in the new working directory, use commands such as <code>cvs update</code> and <code>cvs diff</code> to figure out what has changed, and then when you are ready, commit the changes into the repository.


----

<div class="header">
<p>
Next: [[cvs: Moving a repository#Moving a repository|Moving a repository]], Previous: [[cvs: Creating a repository#Creating a repository|Creating a repository]], Up: [[cvs: The Repository#The Repository|Repository]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
This document was generated on <i>a sunny day</i> using [http://www.nongnu.org/texi2html/ <i>texi2html</i>].
