Slave Synchronisation

Slave Synchronisation

[ Ref: Subversion 1.7.0rc2, OpenBSD 5.0, Replication with svnsync]

Table of Content

* <a href="#synch">Synchronisation</a>

One of the primary values for using Apache as the transport layer for Subversion, is the ability to automatically replicate the repository between multiple sites, but have the clients connecting directly to the master repository for check-ins.

  1. A Master and Slave relationship is in place between sites.
  2. Clients connect to nearest server
  3. Checkout and Update occurs from the the nearest server
  4. Commits are automatically routed to the Master
  5. Commits are automatically replicated from the Master to the Slave
[   v    ]     [       ]
[ master ] --> [ slave ]
[        ]<-+  [    v  ]
            +<---<+ |
                  | |
                  ^ v

Install the Slave Server as we’ve described above, but do not make any subversion commits into the repository.

  • Master to Slave Server
    • svnsync existing tree
    • svnsync new commits
  • Slave to Master Server

Master to Slave Server

svnsync existing tree

svnsync initialize DEST_URL SOURCE_URL

Our intentions

svnsync initialize DEST_URL SOURCE_URL --sync-username dest_username --sync-password dest_password \
    --source-username src_username --source-password src_password
DAV request failed; it's possible that the repository's pre-revprop-change hook either failed or
is non-existent


  • Execute permissions for above mentioned hook-script
  • File permissions for directory (e.g. if using https:// make sure the web user has read/write permissions)
  • /var/apache2/logs/errors.log
    • is the correct –sync-username –source-username passed to the appropriate host
svnsync synchronize DEST_URL SOURCE_URL

In our exercises, we use https: transport protocol

File Permissions / Properties

  • chmod +x for related scripts
  • chown -R _apache2:_apache2 /var/svn/repo

svnsync new commits