红联Linux门户
Linux帮助

SVN服务器迁移(两台Linux机器之间)

发布时间:2015-12-09 10:20:50来源:linux网站作者:Rudon滨海渔村

今天把DiskStation(系统为Linux)上的公用SVN数据克隆到私人电脑,特此记录。


主要流程:

1)以文件形式,dump出源SVN的所有数据

2)scp复制到个人电脑Linux

3)本地安装SVN 并Road入此文件


命令记录:

============================= Source Linux === 
cd /path/to/write/backup/ 
svnadmin dump /home/svn/repos > backup_svn.dump 
zip backup_svn.dump.zip backup_svn.dump 

============================= Target Linux === 
sudo -i 
cd 
mkdir work 
cd work/ 
scp youname@ip-of-source-linux:/path/to/write/backup/backup_svn.dump.zip . 
du -h backup_svn.dump.zip 
unzip backup_svn.dump.zip 
ls 

cd /home/ 
mkdir svn 
cd svn/ 
mkdir repos 
cd repos/ 
mkdir ProjectName 
cd ProjectName/ 
pwd 

apt-get install subversion 
svnadmin create /home/svn/repos/ProjectName 
cd /home/svn/repos/ProjectName 
ls 
cd conf/ 

nano svnserve.conf 
========= Update content like (look out #) ====== 
anon-access = none 
auth-access = write 
password-db = passwd 
authz-db = authz 
========= 

nano passwd 
========= Update content like (look out #) ====== 
yourusername = yourpassword 
root = yourpassword 
========= 

nano authz 
========= Update content like (look out #) ====== 
[groups] 
# harry_and_sally = harry,sally 
# harry_sally_and_joe = harry,sally,&joe 
[/] 
yourusername = rw 
root = rw 
========= 

cd /home/svn/repos/ 
du -sh ProjectName/ 
tar cvzf bak_for_inited_config.tar.gz ProjectName/ 
 
svnadmin load /home/svn/repos/ProjectName/ < /root/work/backup_svn.dump 
svnserve -d -r /home/svn/repos/ProjectName/ 
nano /etc/rc.local  
========= Add content ====== 
svnserve -d -r /home/svn/repos/ProjectName/ 
============================ 

ps aux | grep svnser 
kill -9 {ID-OF-YOUR-OWN-PROCESS-OF-SVNSERVER} 
svnserve -d -r /home/svn/repos/ProjectName/ 

========== Check and Use ============ 
1. Binding fixed IP for your Linux in Router about DHCP 
2. Check whether can access to repos by this command: 
svn ls svn://fixed-ip-of-linux/ 
should see your files in repos 
3. Check out your repos to local dir like: 
1) cd /var/www/project/ 
2) svn checkout svn://fixed-ip-of-linux/any-sub-dir/ 
4. Continue to export/commit 
===================================== 


固定IP容易记。

更多SVN操作请自行搜索学习。


Linux下向SVN服务器添加新文件步骤:http://www.linuxdiyf.com/linux/14778.html

svn服务器配置以及自动同步到web服务器:http://www.linuxdiyf.com/linux/14646.html

linux配置独立svn服务器:http://www.linuxdiyf.com/linux/14000.html

CentOS下搭建SVN服务器详述:http://www.linuxdiyf.com/linux/13061.html

CentOS中SVN服务器的配置过程:http://www.linuxdiyf.com/linux/11473.html