A detailed explanation of the SVN database migration and backup method

Source: Internet
Author: User
Tags svn
A detailed explanation of the SVN database migration and backup method

This section is a brief explanation of the SVN database migration and backup scenarios, the process of learning SVN will inevitably encounter SVN library issues, here and you share the SVN database migration and backup knowledge, I hope to help you learn.

Before you do the migration, stop submitting the SVN operation.
1.SVN Library Migration Scheme (with Dump-load scheme):
SOURCE SVN server: 192.168.1.200,windows server
Target SVN server: 192.168.1.201,windows server. Using Collabnetsubversionserver, assuming Subversion is installed on D:\ProgramFiles\CollabNetSubversionServer, SVN's repository is d:\ Subversion\svnbackup
Also known as the Windows Service, the path to the executable file is: "D:\ProgramFiles\CollabNetSubversionServer\svnserve.exe" –service-r "d:\Subversion\ Svnbackup "–listen-port" 3690″
Since there is actually only content in the Svn://192.168.1.200/rd directory on the Subversion server, you only need to migrate the content under Svn://192.168.1.201/rd, as follows:
1. Perform dump operation on source server 192.168.1.200
Note that all of the directories in the repository are actually backed up and need to be filtered using the Svndumpfilter command to filter the required directories at load time.
Svnadmindumpd:\subversion\svnworkspace\bak>svn_all_20080520.dump
2, create the svnbackuprepository on the 192.168.1.201
Svnadmincreated:\subversion\svnbackup
3, download a Windows version of the GNU tool (such as http://sourceforge.net/projects/gnuwin32/), mainly using the Cat method
4, copy the dump file to the top and perform the load operation
CATSVN_ALL_20080520.DUMP|SVNDUMPFILTER--INCLUDE:RD>SVN_RD_20080520.DUMP5, Executive Svnadminload
SVNADMINLOADD:\SUBVERSION\SVNBACKUP<SVN_RD_20080520.DUMP6, configure svnserve.conf, passwd, Authz files on 192.168.1.201
2.SVN Library Migration Scheme (with Svnsync scheme)
Starting with subversion1.4.4, the Svnsync command is available for Subversion library migrations and backups, where we use initialization synchronization for backup operations.
Assume backup from source server 192.168.1.201 to 192.168.1.88
SVN server: 192.168.1.201,windows server, with Collabnetsubversionserver, assuming subversion is installed in D:\ProgramFiles\ On the Collabnetsubversionserver, SVN's repository is d:\Subversion\svnbackup.
Backup server: 192.168.1.88,REDHATAS4 server
Using Svnsync for data migration, the following methods are:
1. Create the corresponding backup library directory on the source server 192.168.1.201 on the backup server 192.168.1.88
Mkdir/opt/subversion
Svnadmincreate/opt/subversion/svnbackup
2. Enable hook file on backup server 192.168.1.88
Cd/opt/subversion/svnbackup/hooks
echo "#!/bin/sh" >pre-revprop-change
Chmod755pre-revprop-change
3, run the Svnsyncinit command on the backup server 192.168.1.88
Svnsyncinitfile:////opt/subversion/svnbackupsvn://192.168.1.201–usernameusername–passwordpassword
Note that the Svnsync syntax is: svnsyncinitdestsource
4. Perform synchronous operations on backup server 192.168.1.88
Svnsyncsyncfile:////opt/subversion/svnbackup
Since SVNSYC can only synchronize the entire SVN library and cannot synchronize the specified items, it is recommended that the Dump-load scenario be used when migrating and that the Svnsync scenario be used for backup
3.SVN Library Backup Scenario:
To ensure the security of the SVN server, the scripts are backed up on a daily basis by the script to keep the SVN library secure. Backup is still done using Svnsync.
1. Install the Subversion server side on the 192.168.1.88
2. Create a backup user account Svnsync on the 192.168.1.88 to allow 192.168.1.201 to synchronize the changes to 192.168.1.88 in real time
Configuration file svnserve.conf:
[General]
Anon-access=none
Auth-access=write
password-db=passwd
Authz-db=authz
Configuration file passwd:
Svnsync=svnsync
Configuration file Authz
[Groups]
Developer=svnsync[/]
@developer =rw*=
3. Open the Iptables 3690 port on the backup machine
4. Create a backup library directory on the backup machine 192.168.1.88
Svnadmincreate/opt/subversion/svnbackup
Chown–rsvnsync:svnsync/opt/subversion/svnbackup
5. According to the above steps of adopting the Svnsync scheme, synchronize the library to the 192.168.1.88, initialize the SVN library
Cd/opt/subversion/svnbackup/hooks
echo "#!/bin/sh" >pre-revprop-change
Chmod755pre-revprop-change
Svnsyncinitfile:////opt/subversion/svnbackupsvn://192.168.1.201–usernameusername–passwordpassword
Svnsyncsyncfile:////opt/subversion/svnbackup
6. On the source server 192.168.1.201, create a hook file to ensure that the changes on the 192.168.1.201 real-time synchronization to the 192.168.1.88:
Post-commit
#PropagatethedatatotheremoterepositoryD: \programfiles\collabnetsubversionserver\ Svnsyncsynchronize--usernamesvnsync--passwordsvnsyncsvn://192.168.1.88post-rev-changes
#Propagatingchangestotheremoterepository. D:\ProgramFiles\CollabNetSubversionServer\bin\ Svnsynccopy-revprops--usernamesvnsync--passwordsvnsyncsvn://192.168.1.88$rev4. Reference Document: http://blog.notreally.org/ articles/2006/11/30/setting-up-a-subversion-mirror-repository-using-svnsync/
Http://whynotwiki.com/How_I_moved_my_code_repository_to_Google_Code. For an explanation of the SVN repository migration and backup content in this section, please pay attention to other relevant reports in this section.
Turn from: http://developer.51cto.com/art/201005/202261.htm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.