This documentation was written to describe the 1.7.x series of Apache™ Subversion®. If you are running a different version of Subversion, you are strongly encouraged to visit http://www.svnbook.com/ and instead consult the version of this documentation appropriate for your version of Subversion.

Name

svnsync initialize (init) — Initialize a mirror repository for synchronization from the source repository.

Synopsis

svnsync initialize MIRROR_URL SOURCE_URL

Description

svnsync initialize verifies that a repository meets the basic requirements of a new mirror repository and records the initial administrative information that associates the mirror repository with the source repository (specified by SOURCE_URL). This is the first svnsync operation you run on a would-be mirror repository.

Ordinarily, SOURCE_URL is the URL of the root directory of the Subversion repository you wish to mirror. Subversion 1.5 and newer allow you to use svnsync for partial repository mirroring, though — simply specify the URL of the source repository subdirectory you wish to mirror as SOURCE_URL.

By default, the aforementioned basic requirements of a mirror are that it allows revision property modifications and that it contains no version history. However, as of Subversion 1.7, you may now optionally disable the verification that the target repository is empty using the --allow-non-empty option. While the use of this option should not become habitual (as it bypasses a valuable safeguard mechanism), it does aid in one very common use-case: initializing a copy of a repository as a mirror of the original. This is especially handy when setting up new mirrors of repositories which contain a large amount of version history. Rather than initialize a brand new repository as a mirror and then syncronize all of the history into it, administrators will find it significantly faster to first make a copy of the mature repository (perhaps using svnadmin hotcopy) and then use svnsync initialize --allow-non-empty to initialize that copy as a mirror which is now already up-to-date with the original.

Options

Examples

Fail to initialize a mirror repository due to inability to modify revision properties:

$ svnsync initialize file:///var/svn/repos-mirror \
                     http://svn.example.com/repos
svnsync: Repository has not been enabled to accept revision propchanges;
ask the administrator to create a pre-revprop-change hook
$

Initialize a repository as a mirror, having already created a pre-revprop-change hook that permits all revision property changes:

$ svnsync initialize file:///var/svn/repos-mirror \
                     http://svn.example.com/repos
Copied properties for revision 0.
$