发布日期:2017-06-21 14:18:24

如何移植svn文件库? how to move an svn repository to a new server?

这个话题网上已经有很多很好的总结,这里记录两个中英文的总结以供参考。

  • https://stackoverflow.com/questions/3789585/how-to-move-an-svn-repository-to-a-new-server
  • http://blog.chinaunix.net/uid-354915-id-3766906.html
  • http://www.cnblogs.com/yanghj010/p/5075851.html
关闭所有运行的进程,并确认没有程序在访问存储库(如 httpd、svnserve 或本地用户在直接访问)。
备份svn存储库
#压缩备份
svnadmin dump /home/workhome/svn/repository | gzip > ~/repository-backup.gz
#不压缩备份
svnadmin dump /home/workhome/svn/repository > ~/repository-backup.svn
恢复svn存储库
#建立新的svn存储库
svnadmin create /home/workhome/svn/newrepository
#确认成功与否
ls -l /home/workhome/svn/newrepository
#导入存储库数据
svnadmin load /home/workhome/svn/newrepository < ~/repository-backup.svn

引文:

You can migrate a repository using the svnadmin dump function. On the SVN server, type svnadmin dump /absolute/path/to/the/repo > /tmp/repo.svndump. This will export the entire repository to a text file in the system's temporary directory and name it "repo.svndump". You might want to compress that file before transferring it to the new server.

Once you have the repo exported, you can then transfer the dump file to the new server and import it like so: svnadmin load /absolute/path/to/the/**new**/repo < repo.svndump.

See 'svnadmin dump' and 'svnadmin load' for more information.

After dumping the repository and loading it on the new server you would use the --relocate command to switch your local copy to the new server.

Caution: If your repositories use any externals then you will have some problems. See my question on Server Fault for details about this.

 

发表评论