Wednesday, September 28, 2011

SVN Migrate folder to new repository root

Since I've been asked about Subversion's "svnsync" command more than once, here is a copy of my post on stackoverflow.

The svnsync option worked for me with subversion 1.5.3.
Here is a Windows batch script to accomplish this:
SET OLD_REPO_URL=https://old-project-repo/my-project
SET NEW_REPO_URL=C:/Repositories/new-project-repo
SET NEW_REPO_FILE_PATH=C:\Repositories\new-project-repo

svnadmin create %NEW_REPO_FILE_PATH%
echo exit 0 > %NEW_REPO_FILE_PATH%\hooks\pre-revprop-change.bat

svnsync init file:///%NEW_REPO_URL% %OLD_REPO_URL%
svnsync sync file:///%NEW_REPO_URL%
Note: You will not be able to browse the new repository until the sync is finished.

No comments:

Post a Comment