Using svnsync to migrate an SVN repository to another site

I recently had to migrate our SVN repository from one SVN service to another.  Normally, this is done via svnadmin dump and svnadmin load, but I did not have administrative command line access to one of the environments, so I had to use the svnsync tool to accomplish this.  Took me a while to figure out how to do it, and naturally and I didn't write it down, so when I had to do this the second time around, I forced myself to blog it, so when I had to do it the third time, I woul dhave some reference material.  This blog entry really has little to do with sharing with you (the reader), but rather sharing with "future me" ;-)

Anyway, the tool to use is svnsync, but the docs are a bit sparce.  Mirroring the repository is a two step process.

  1. First, the destination repository has to be set up via the svnsync init command, which confusingly takes the DESTINATION repository URL argument before the SOURCE repository URL (this one stumped for a while):

    svnsync init --sync-username username --sync-password password DEST_REPOSITORY_URL SRC_REPOSITORY_URL

  2. Once the destination repository is set up, you can use the svnsync sync command to initiate the copy.  In case the sync fails (e.g. due to network failures), this command can be restarted as frequently as necessary to copy the entire repository.  The primary use of svnsync is to create mirrors, so some folks even run this out of cron to periodically sync the repositories:

    svnsync sync --sync-username username --sync-password password DEST_REPOSITORY_URL

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Ari Shamash is the software engineering manager of the Sun Software Library engineering team at Sun Microsystems.

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today