Article Source:
Http://www.linuxidc.com/Linux/2013-05/84693p2.htm
Migrating SVN repositories
The recent server hard drive bad channel caused frequent automatic shutdown, so you need to migrate SVN to the new server.
Use the same method in the new service to build SVN, and then export the original SVN repository data, and then import into the new SVN repository.
1. Export operations on the old server:
$ svnadmin Dump the directory path of the original repos (/repository/directory) > Dumpfile.svndump
2. Import the dumpfile.svndump into the new repository directory on the new server.
$ svnadmin Load New repos directory path (/repository/directory) < Dumpfile.svndump
If the project warehouse is more, attach a batch export command, the import changes will be OK:
- #!/bin/bash
- CD /home/svn
- FileList=' ls '#符号 • Is not a single quote but is located on the left side of the keyboard exclamation mark
- For fname in $filelist
- Do
- Svnadmin dump $fname >/home/svndump/${fname}. Svndump
- #echo $fname
- #最好是root用户执行, or sudo.
- Done
Then the local project SVN checkout and update address needs to be changed, using the TortoiseSVN tool right-click to find the relocate menu, and the use of the command is as follows:
- #在项目目录查看下仓库地址
- $ SVN Info
- #回显中的URL项就是旧版地址oldpath
- #然后切换到新版地址newpath即可
- $ svn Switch--relocate http://oldpath http://newpath
- #查看信息确认下
- $ SVN Info
Migrating SVN repositories under Linux