SVN source code repository migration

   Recently, the company's source code server has always had some small problems. For safety, the old SVN server was migrated to the new machine.
   The old server is a Linux RedHat Enterprise system, and the new server is a windows operating system.

1. Install SVN service on windows server

1. Download SVN
http://subversion.tigris.org/files/documents/15/47866/svn-win32-1.6.0.zip

2. Installation: After downloading, it will be installed Unzip the package to E:\subversion

3. Create a Repository: For example, create a new svn source code repository in the E:\svndata directory, open the command console with CMD, and enter the following command to complete the creation of the code repository svn

E:\subversion\bin \svnadmin.exe create --fs-type fsfs e:\svndata\svn

4. Configure Repository: Enter the Repository directory, the example in this article is e:\svndata\svn, after entering, you will see that there is a conf directory under svn, enter the directory , two files, svnserve.conf and passwd, will be found, and corresponding modifications and configurations will be made accordingly. (
Note: There cannot be a space before the [general] in svnserve.conf and the [users] configuration item in passwd, and there can only be one space after the "=")

5. Start SVN: Open the command window, type the following startup command, if If your installation path is different from the example in this article, pay attention to modify the svn installation path and Repository path. After running the command, you will find that there is svnserve.exe in the process manager, indicating that the configuration is successful.

E:\subversion\bin\svnserve.exe -d -r E:\svndata The

default port of SVN is 3690. If unfortunately this port is temporarily used by other programs, you can use the option –listen-port= to bind the port

6.SVN configuration Test:

The url format is svn://ip address//Repository name, and the example url in this article is svn://127.0.0.1/svn So

far, the SVN configuration can basically be used.


2. SVN database backup and migration

svnadmin hotcopy method: the original design purpose is not intended to be used for backup, only full copy can be performed, and incremental backup cannot be performed;
the advantages are: the backup process is faster, and the disaster recovery is also very fast; if the backup machine The svn service has been set up, and you don't even need to restore it. You only need to perform a simple configuration to switch to the backup library to work.

1. Backup
svnadmin hotcopy /home/svnroot/svn/ /var/tmp/svndata_20160119 --clean-logs

If you pass the --clean-logs option, svnadmin will perform a hot copy operation and delete the unused Berkeley DB log files.
You can run this command at any time to get a safe copy of the repository, regardless of whether other processes are using the repository.

2. Restore
Copy the

E:\subversion\bin\svnadmin hotcopy /svndata_20160119 E:/svndata/svn/


3. SVN auto-start service
Create a new file svnSetup.bat.

Enter:

sc create svnserve binpath= "\"E:\subversion\bin\svnserve.exe\" --service --root E:\svndata" displayname= "Subversion" depend= tcpip start = auto
sc start svnserve


select "run as administrator".
binpath specifies the path and command of svnserve. Note that the parameter is --service, not --daemon. Parameters such as -d and -i, -t cannot be used. start=auto means that the service starts automatically. Note that there is no space to the left of the equals sign, but there must be one space to the right.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326682852&siteId=291194637