现在的位置: 首页 > 综合 > 正文

安装新SVN,并导入之前SVN版本库操作手记

2013年08月23日 ⁄ 综合 ⁄ 共 2102字 ⁄ 字号 评论关闭

svn服务器有2种运行方式:独立服务器和借助apache。2种方式各有利弊,本次安装时使用的是独立用品方式。
svn存储版本数据也有2种方式:BDB和FSFS。因为BDB方式在服务器中断时,有可能锁住数据所以还是FSFS方式更安全一点,我安装时也使用的是FSFS方式。

一.下载svn

下载地址:http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=260&expandFolder=74

选择subversion-1.6.1.tar.gz 和 subversion-deps-1.6.1.tar.gz

二.安装

cd /usr/local/

tar zxvf subversion-1.6.1.tar.gz

tar zxvf subversion-deps-1.6.1.tar.gz #会自动解压到subversion-1.6.1下
cd subversion-1.6.1

按照一些网络资料的介绍,执行如下命令即可完成安装

./configure --without-berkeley-db --prefix=/usr/local/subversion

make

make install

 

#错误提示1#

configure: error: We require OpenSSL; try --with-openssl

解决方法:

错误提示需要安装openssl,所以我就安装了一个openssl,安装方法如下:

cd /usr/local

wget http://www.openssl.org/source/openssl-1.0.0a.tar.gz

tar -zxvf openssl-1.0.0a.tar.gz

cd openssl-1.0.0a

./config 
./config -t 
make depend
make 
make test 
make install

安装之后会在/usr/local下生成一个ssl目录

设置环境变量,在/etc/profile的PATH中增加如下内容:

PATH=/usr/local/ssl/bin:/sbin/:$PATH:/usr/sbin
export PATH

ok,错误提示1解决。

 

重新执行./configure --with-openssl=/usr/local/ssl #这里加上--with-openssl参数

#错误提示2#

configure: error: subversion requires zlib

 

解决方法:

cd /usr/local

wget  http://zlib.net/zlib-1.2.5.tar.gz
tar -xvzf zlib-1.2.5.tar.gz
cd zlib-1.2.5
./configure
make
make install

 

cd /usr/local

ln -s zlib-1.2.5 zlib

 

ok,错误提示2解决。

 

重新执行./configure --with-openssl=/usr/local/ssl --with-zlib=/usr/local/zlib ,成功!

 

接着执行如下命令:

make

make install

完成后屏幕会提示

You don't seem to have Berkeley DB version 4.0.14 or newer
installed and linked to APR-UTIL.  We have created Makefiles which
will build without the Berkeley DB back-end; your repositories will
use FSFS as the default back-end.  You can find the latest version of
Berkeley DB here:

http://www.oracle.com/technology/software/products/berkeley-db/index.html

 make && make install

 

ok,svn安装完成。

建立版本库

svnadmin create /work/svndata

进入/tmp目录下,然后进行checkout操作
svn co svn://192.168.1.111/svntest

查看文件log的历史记录
[root@CentOS_Test_Server svntest]# svn log test

 

SVN迁移

SVN迁移可能有很多原因, 可能是我们想换Repository目录, 或者是想换一台机器, 等等. 
SVN迁移很容易做, 按照下面步骤就可以: 

1. 将原来的Repository导出为一个文件dumpfile 
> svnadmin dump path/to/old-repo > dumpfile 

2. 创建新的Repository, 创建方法可以参考 Windows 平台安装Subversion server 

3. 将dumpfile导入到新的Repository 
> svnadmin load path/to/new-repo < dumpfile 

4. 检查新的Repository的conf/目录下的配置文件, 检查hooks/目录下的构子程序等等...

抱歉!评论已关闭.