SVN project backup
Use the svnadmin tool to export locally.
cd H:\Repositories
svnadmin dump H:\Repositories\test > F:\svn_dump\test.dump svnadmin dump H:\Repositories\android > F:\svn_dump\android.dump svnadmin dump H:\Repositories\BackEnd > F:\svn_dump\BackEnd.dump svnadmin dump H:\Repositories\DevOps> F:\svn_dump\DevOps.dump svnadmin dump H:\Repositories\ios > F:\svn_dump\ios.dump svnadmin dump H:\Repositories\pigcms > F:\svn_dump\pigcms.dump svnadmin dump H:\Repositories\Product > F:\svn_dump\Product.dump svnadmin dump H:\Repositories\UI > F:\svn_dump\UI.dump svnadmin dump H:\Repositories\wechat > F:\svn_dump\wechat.dump svnadmin dump H:\Repositories\WorkLogs > F:\svn_dump\WorkLogs.dump
Upload the above dump file to centos 7 through ftp tool, and upload the copies of user and group permission files group.conf and htpasswd to centos.
centos 7 SVN installation and configuration
1. installation
yum install subversion
Version: svnserve -version
2. Create the svn version library, taking the test library project as an example.
mkdir -p /workstation/svn_code/Repositories\test svnadmin create /workstation/svn_code/Repositories\test svnadmin create /workstation/svn_code/Repositories\android svnadmin create /workstation/svn_code/Repositories\BackEnd svnadmin create /workstation/svn_code/Repositories\ios
Ls / workstation / SVN? Code / Repositories \ test? Generate repository Repositories files
3. Configure svn information
cd /workstation/svn_code/Repositories/test/conf
vim authz
Add user group under group
admin = admin
Add user group permission in [project: /]
@admin=rw / / where @ means for user group, * means all users
vim passwd
[users] Configure user name and password admin = admin123
vim svnserve.conf
Cancel the following note:
anon-access = read auth-access = write password-db = passwd authz-db = authz #Access control file realm = project #Authentication namespace
vim /root/.subversion/servers
Revised to:
store-plaintext-passwords = yes
Confirm the installation of openssl and openssl devel
yum install openssl openssl-devel
4.svn start, connect
Enabling:
svnserve -d -r /workstation/svn_code/Repositories
Connect:
svn import submits a tree or file that is not under version control to the version library. The versioned file was not imported into the version library.
svn import project svn://IP/project/ -m "admin"
Import backup file
Order:
svnadmin load /workstation/svn_code/Repositories/test < /home/svn_bak/test.dump svnadmin load /workstation/svn_code/Repositories/android < /home/svn_bak/android.dump svnadmin load /workstation/svn_code/Repositories/BackEnd < /home/svn_bak/BackEnd.dump svnadmin load /workstation/svn_code/Repositories/DevOps < /home/svn_bak/DevOps.dump svnadmin load /workstation/svn_code/Repositories/ios < /home/svn_bak/ios.dump svnadmin load /workstation/svn_code/Repositories/pigcms < /home/svn_bak/pigcms.dump svnadmin load /workstation/svn_code/Repositories/Product < /home/svn_bak/Product.dump svnadmin load /workstation/svn_code/Repositories/UI < /home/svn_bak/UI.dump svnadmin load /workstation/svn_code/Repositories/wechat < /home/svn_bak/wechat.dump svnadmin load /workstation/svn_code/Repositories/WorkLogs < /home/svn_bak/WorkLogs.dump
Batch import, script shell
#!/bin/bash DIR_HOME="/home/svn_bak" SVN_HOME="/workstation/svn_code/Repositories" files=`cd $DIR_HOME;ls` pro="test android BackEnd DevOps ios pigcms Product UI wechat WorkLogs" for file in $files; do #get all *dump files project=`echo $file | sed -n '/.*\.dump/p' | cut -d '.' -f1` if [ "$project"x != ""x ];then if [ "$project" = "$pro" ];then continue fi create_dir="svn create $SVN_HOME/$project" svn_load="svnadmin load $SVN_HOME/$project < $DIR_HOME/$project.dump" execute create_dir order echo $create_dir eval $create_dir execute svn_load order echo $svn_load eval $svn_load fi done
Client code check out test
Windows client TortoiseSVN checkout.