How to use svnsync in Windows environments

Still need help?

The Atlassian Community is here for you.

Ask the community

Please note

The solution provided in this article is not supported by Atlassian because it does not involve Atlassian products directly, this is considered third-party product integration.


It is recommended to use svnsync in order to mirror remote repositories currently indexed via http/s protocol onto the Fisheye/Crucible server, so that you can access it with the file:// protocol and greatly increase the indexing speed.

However, the svnsync link in our documentation redirects to Apache documentation which only has usage instructions for Linux hosts.

The purpose of this article is to provide a way to use svnsync in Windows hosts.


The svnsync command is part of Subversion, so you must have Subversion installed on the Windows machine running Fisheye, otherwise the svnsync command will not be found in that server. Subversion can be downloaded from here.

After installing Subversion on the machine running Fisheye, please open a new Command Prompt and run svnsync, just to make sure that the command is found. If it is found, you should see an output message saying Type 'svnsync help' for usage.

After that, you should be able to follow steps similar to the ones from svnsync guide:

  1. First, you need to create your destination repository in the Fisheye server. Let's suppose you want to mirror the repositories into a directory named C:\Repositories
    Using Command Prompt, go to C:\Repositories and create an empty repository there. Let's say that the name of the repository is Repo1. In that case, you should run a command like this:

    C:\Repositories>svnadmin create Repo1

    The command above will not output any messages, but the repository will be created.

  2. Exploring Repo1 you'll see you have a hooks directory. The files in this directory are Linux bash scripts and won't work in Windows hosts.
    The svnsync program needs to store some special properties about its own synchronisation activities. It does this by setting some properties on the repository at revision 0. In order to do this, there has to be a valid pre-revision property change hook on the repository that calls exit 0. This hook is also a perfect place to put your check that only a specific user (for example, svnsync) is allowed to do things. 
    Please create a file named pre-revprop-change.bat at C:\Repositories\Repo1\hooks having the following content:

    IF "%3" == "svnsync" (goto :label1) else (echo "Only the svnsync user can change revprops" >&2 )
    exit 1
    goto :eof
    exit 0

    Feel free to change the username svnsync as you wish.

  3. Go back to C:\Repositories and run a command that follows this example:

    C:\Repositories>svnsync init --sync-username svnsync file:///C:/Repositories/Repo1 --source-username svnadminusr --source-password svnadminusrpwd
    Copied properties for revision 0.

    a) The username specified in sync-username parameter is the one that will be validated by the pre-revprop-change.bat script
    b) The URL file:///C:/Repositories/Repo1 refers to the empty repository created in Fisheye server
    c) The username and password specified in source-username and source-password should be from a Subversion administrator user that has access to the entire tree of the remote repository
    d) The URL refers to the remote repository you want to clone onto the Fisheye server.

    Note: credentials for the source repository can be provided using --source-username and --source-password and for the destination using --sync-username and --sync-password. These credentials are cached in the same way other credentials are cached.

  4. Go to C:\Repositories\Repo1 and run this command in order to start syncing (remembering to change the URL to mach the repository created in Fisheye server):

    C:\Repositories\Repo1>svnsync sync file:///C:/Repositories/Repo1
    Committed revision 1.
    Copied properties for revision 1.
    Transmitting file data .
    Committed revision 2.
    Copied properties for revision 2.

Last modified on Apr 22, 2020

Was this helpful?

Provide feedback about this article
Powered by Confluence and Scroll Viewport.