Using svnsync to migrate a Subversion repository
This article is equally applicable whether you are looking to migrate an existing Subversion repository to SVNsite, or if you are just looking to move one of your own repositories somewhere else.
First, this assumes that you have a new, clean repository to work with (such as the one created for you by SVNsite when your account is created and activated). The second assumption is that the migration will only happen once, svnsync is only appropriate to use once to migrate an existing repository to a new one, or when you intend to have a read-only mirror of a primary subversion repository. This tutorial assumes that your intent is to migrate an existing repository
Configure your repository in preparation for migration
Before you run svnsync, you must allow the svnsync process to change properties on your target repository. To do this, logon to the machine where your future repository is and go into the root directory of your repository.
There you should find a directory called hooks, go into this directory and look at the pre-rev-prop-change.tmpl, this is a template file for the pre-rev-prop-change file and should indicate the format of the file for you. Once you are happy with any changes you have made to the pre-rev-prop-change.tmpl file, simply copy it into the same directory but without a file-ending (pre-rev-prop-change). This will automatically make the pre-rev-prop-change hook active.
Running svnsync
You should now be ready to run the svnsync commands:
initialize the sync:The last step will take some time depending on the size and complexity of your pre-existing repository, so you should just let it run. If it succeeds, your new repository should be ready for use! If svnsync terminates for some reason, you will probably need to clean up the svnsync locks to be able to run it (or anything else), which can be done by running the following command:
$ svnsync init [target repository] [source repository] transfer the actual data:
svnsync --non-interactive sync [target repository]
svn propdelete svn:sync-lock --revprop -r 0 [target repository]