当因为内存限制或者其他某些原因,我们需要将svn版本从一个服务器A迁移到另外一个服务器B,本篇文章为大家讲解一下傻瓜式SVN版本库迁移。
全量导出:
压缩备份:
[root@aliyun home] svnadmin dump /home/svn/repos1 | gzip > ./repos1.gz
不压缩备份:
[root@aliyun home] svnadmin dump /home/svn/repos1 > ./repos1.svn
增量导出:
[root@aliyun home] svnadmin dump /home/svn/repos1 -r 0:50 > repos1
[root@aliyun home] svnadmin dump /home/svn/repos1 -r 51:100 --incremental > repos2
[root@aliyun home] svnadmin dump /home/svn/repos1 -r 101:150 --incremental > repos3
注意了如果是增量导出(新版本库中已经导入过版本)需要加–incremental 参数
[root@svn home] svnadmin create /home/svn/reposnew
压缩过的文件不能直接导入,需要解压(所以如果两台服务器可以内网通信完全不需要进行压缩)
[root@svn home] gzip -d repos1.gz
[root@svn home] svnadmin load /home/svn/reposnew
未压缩文件直接导入即可:
[root@svn home] svnadmin load /home/svn/reposnew
如果是分版本导入出现该错误提示就是因为导出文件时没有加参数 –incremental 导致:
[root@svn home] svnadmin load /home/svn/reposnew 'reposnew/db',......
导入的过程可能花费的时间较长,完成后设置好账户密码通过本地svn客户端浏览测试。
迁移了SVN版本库自然的本地电脑上的地址也需要更换,windows 下如下:
在弹出框中修改为新的地址即可。
如果服务器上有直接从SVN版本库中提取代码,那么也是需要修改地址,先查看服务器上对于目录的信息可以获取到SVN地址:
[root@aliyun home] svn info /data/wwwroot/test
Path: .
Working Copy Root Path: /data/wwwroot/test
URL: svn://192.168.31.8/cnyunwei/test
Repository Root: svn://192.168.31.8/cnyunwei
Revision: 335
.......
修改地址通过svn switch 命令,基本格式如下:
[root@aliyun test] svn switch --relocate svn://old_IPADDR/repos http://new_IPADDR/repos
例如上面这个目录就需要调整为:
[root@aliyun test] svn switch --relocate svn://192.168.31.8/cnyunwei/test http://192.168.31.10/cnyunwei/test
再次查看信息就会变更了:
[root@aliyun test] svn info /data/wwwroot/test
Path: .
Working Copy Root Path: /data/wwwroot/test
URL: svn://192.168.31.10/cnyunwei/test
Repository Root: svn://192.168.31.10/cnyunwei
.......
到此SVN 的迁移才算完成了。
网站题目:傻瓜式SVN版本库迁移
文章链接:http://www.csdahua.cn/qtweb/news15/347715.html
网站建设、网络推广公司-快上网,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 快上网