qht131: svn 1.5.3服务器端
qht25:svn 1.6.11客户端
qht132:svn 1.9.5服务器端
1.旧版本的服务器端开启svn服务
[root@qht131 ~]# svn --version
svn, version 1.5.3 (r33570)
compiled Mar 17 2022, 10:57:13
Copyright (C) 2000-2008 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).
The following repository access (RA) modules are available:
* ra_svn : Module for accessing a repository using the svn network protocol.
- with Cyrus SASL authentication
- handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
- handles 'file' scheme
开启svn服务
[root@qht131 ~]# svnserve -d -r /home/svn/project/ --config-file=/home/svn/project/conf/svnserve.conf
[root@qht131 ~]#
[root@qht131 ~]# netstat -nal | grep 3690
tcp 0 0 0.0.0.0:3690 0.0.0.0:* LISTEN
2.客户端连接老版本svn,并将数据 checkout到本地的common目录
[ljg@qht25 ~]$ svn --version
svn, version 1.6.11 (r934486)
compiled Sep 27 2011, 15:29:25
[ljg@qht25 ~]$ pwd
/home/ljg
[ljg@qht25 ~]$ svn --username admin --password admin co svn://172.17.61.131/ common
[ljg@qht25 ~]$ cd common/
[ljg@qht25 common]$ ls
build build2.xml build.xml dist libs src tests
[ljg@qht25 common]$ svn list
.classpath
.project
.settings/
.taginfo
build/
build.xml
build2.xml
dist/
libs/
src/
tests/
[ljg@qht25 comm
[ljg@qht25 common]$ vi build.xml //修改文件的任意内容
[ljg@qht25 common]$ svn ci -m "modify 1st" //将本地修改的数据同步到服务器
Sending build.xml
Transmitting file data .
Committed revision 2.
[ljg@qht25 common]$ svn update //将服务器上新的数据同步到本地
At revision 2.
3.在服务器端用dump命令备份所有的数据
[root@qht131 home]# svnadmin dump /home/svn/project/ > project.bak
* Dumped revision 0.
* Dumped revision 1.
* Dumped revision 2.
* Dumped revision 3.
dump会将所有版本的更新都备份出来,所以文件会比较大
[root@qht131 svn]# du -hs
35M .
[root@qht131 home]# ls -lth
total 56M
-rw-r--r-- 1 root root 55M Mar 21 16:36 project.bak
在数据仓库里只占用了35M,而导出的数据则有55M.
4.将dump复制到新版本svn的服务器上
[root@qht131 home]# scp project.bak 172.17.61.132:/u01
?在新版本的svn上导入project.bak
[root@qht132 u01]# svn --version
svn, version 1.9.5 (r1770682)
compiled Mar 20 2022, 16:41:13 on x86_64-unknown-linux-gnu
[root@qht132 u01]# svnadmin load /u01/data/repos/ < /u01/project.bak
。。。。
* editing path : tests/props/L5MOnline.config ... done.
* editing path : tests/props/dbProvider.prop ... done.
* editing path : tests/props/unitlogger.prop ... done.
------- Committed revision 1 >>>
<<< Started new transaction, based on original revision 2
* editing path : build.xml ... done.
------- Committed revision 2 >>>
<<< Started new transaction, based on original revision 3
* editing path : test.sh ... done.
------- Committed revision 3 >>>
5.尝试用低版本的客户端连接新版本的服务
[htwei@qht25 ~]$ svn --username admin --password admin co svn://172.17.61.132/ common
svn: Can't connect to host '172.17.61.132': No route to host
发现连接不了,客户端的版本太低了,而且1.5到1.9版本跨度太大了。
6.用新版本的客户端连接
在qht132上新建一个用户作为客户端
[root@qht132 ~]# useradd lxx
[root@qht132 ~]# passwd lxx
[root@qht132 ~]# su -lxx
[root@qht132 ~]# svn --version
svn, version 1.9.5 (r1770682)
compiled Mar 20 2022, 16:41:13 on x86_64-unknown-linux-gnu
[lxx@qht132 ~]$ svn --username admin --password admin co svn://172.17.61.132/ common
。。。。。。
A common/tests/props/dbProvider.prop
A common/tests/props/unitlogger.prop
A common/.classpath
A common/.project
A common/.taginfo
A common/build.xml
A common/build2.xml
A common/test.sh
Checked out revision 3.
成功checkout.
|