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.

svnsync—Subversion Repository Mirroring

svnsync is the Subversion remote repository mirroring tool. Put simply, it allows you to replay the revisions of one repository into another one.

In any mirroring scenario, there are two repositories: the source repository, and the mirror (or sink) repository. The source repository is the repository from which svnsync pulls revisions. The mirror repository is the destination for the revisions pulled from the source repository. Each of the repositories may be local or remote—they are only ever addressed by their URLs.

The svnsync process requires only read access to the source repository; it never attempts to modify it. But obviously, svnsync requires both read and write access to the mirror repository.

[Warning] Warning

svnsync is very sensitive to changes made in the mirror repository that weren't made as part of a mirroring operation. To prevent this from happening, it's best if the svnsync process is the only process permitted to modify the mirror repository.

svnsync Options

Options in svnsync are global, just as they are in svn and svnadmin:

--allow-non-empty

Disables the verification (which svnsync initialize performs by default) that the repository being initialized is empty of history version.

--config-dir DIR

Instructs Subversion to read configuration information from the specified directory instead of the default location (.subversion in the user's home directory).

--config-option CONFSPEC

Sets, for the duration of the command, the value of a runtime configuration option. CONFSPEC is a string which specifies the configuration option namespace, name and value that you'd like to assign, formatted as FILE:SECTION:OPTION=[VALUE]. In this syntax, FILE and SECTION are the runtime configuration file (either config or servers) and the section thereof, respectively, which contain the option whose value you wish to change. OPTION is, of course, the option itself, and VALUE the value (if any) you wish to assign to the option. For example, to temporarily disable the use of the compression in the HTTP protocol, use --config-option=servers:global:http-compression=no. You can use this option multiple times to change multiple option values simultaneously.

--disable-locking

Causes svnsync to bypass its own exclusive access mechanisms and operate on the assumption that its exclusive access to the mirror repository is being guaranteed through some other, out-of-band mechanism.

--no-auth-cache

Prevents caching of authentication information (e.g., username and password) in the Subversion runtime configuration directories.

--non-interactive

In the case of an authentication failure or insufficient credentials, prevents prompting for credentials (e.g., username or password). This is useful if you're running Subversion inside an automated script and it's more appropriate to have Subversion fail than to prompt for more information.

--quiet (-q)

Requests that the client print only essential information while performing an operation.

--revision (-r) ARG

Used by svnsync copy-revprops to specify a particular revision or revision range on which to operate.

--source-password PASSWD

Specifies the password for the Subversion server from which you are syncing. If not provided, or if incorrect, Subversion will prompt you for this information as needed.

--source-prop-encoding ARG

Instructs svnsync to assume that translatable Subversion revision properties found in the source repository are stored using the character encoding ARG and to transcode those into UTF-8 when copying them into the mirror repository.

--source-username NAME

Specifies the username for the Subversion server from which you are syncing. If not provided, or if incorrect, Subversion will prompt you for this information as needed.

--steal-lock

Causes svnsync to steal, as necessary, the lock which it uses on the mirror repository to ensure exclusive repository access. (This option should only be used when a lock exists in the mirror repository and is known to be stale—that is, when you are certain that there are no other svnsync processes accessing that repository.)

--sync-password PASSWD

Specifies the password for the Subversion server to which you are syncing. If not provided, or if incorrect, Subversion will prompt you for this information as needed.

--sync-username NAME

Specifies the username for the Subversion server to which you are syncing. If not provided, or if incorrect, Subversion will prompt you for this information as needed.

--trust-server-cert

Used with --non-interactive to accept any unknown SSL server certificates without prompting.

svnsync Subcommands

Here are the various subcommands for the svnsync program.