Using svnsync to migrate a remote svn repository

PDF

I recently needed to move over my code base from a remote repository to another remote repository using Subversion. To accomplish this I used svnsync, as demonstrated by this excellent little article. Here’s a quick Windows version of that article, demonstrating a google code project migration.

This article assumes you need to move code from a remote repo to another remote repo; if you’re moving it local, you’ll need to setup your own svn server and repo etc, which is not covered here.

  • Make sure you’ve reset your Google Code project’s repository. You can find this option under Administer -> Source -> Repository (Reset this project’s repository link). If you’re not using Google Code, you need to completely reset it or create a new one. Svnsync apparently is very picky on existing changes in the target codebase.
  • Make sure svnsync is the only user of the server during the mirroring operation.

Step by step

  1. Open up the command prompt and set the source and target repo url:

    set FROMREPO=https://YOUR-OLD-PROJECT.googlecode.com/svn/
    set TOREPO=https://YOUR-NEW-PROJECT.googlecode.com/svn/

  2. Initialize svnsync with these urls. You will be asked for your username/password after running this command. You can find your password when you’re signed into Google code, under Profile (top right when you’re at a project) -> Settings -> GoogleCode.com Password.
  3. svnsync init %TOREPO% %FROMREPO%

  4. Finally to start the process, execute the following:

    svnsync --non-interactive sync %TOREPO%

Tags:
  • Pablo Beltran

    Thank you! It worked perfectly! And yes! In 2019 there is still an SVN repo operative that needed to be migrated 😛

    Reply

Leave a Reply to Pablo Beltran Cancel Reply