A, svn installation services
System Environment: Centos7.6
1, mounted by yum command svnserver
yum -y install subversion
2, create a version release inventory directory (not the repository, just the directory)
mkdir /data/svnrepos
3. Create Repository (svntest repository)
svnadmin create /data/svnrepos/svntest
svntest directory file information
drwxr-xr-x 2 root root 4096 Oct 28 14:58 conf drwxr-sr-x 6 root root 4096 Oct 28 15:16 db -r--r--r-- 1 root root 2 Oct 28 14:58 format drwxr-xr-x 2 root root 4096 Oct 28 14:58 hooks drwxr-xr-x 2 root root 4096 Oct 28 14:58 locks -rw-r--r-- 1 root root 229 Oct 28 14:58 README.txt
4, modify the configuration
Enter the conf directory under the directory svntest
cd / data / svnrepos / svntest / conf
We have the following profile:
-rw-r--r-- 1 root root 1080 Oct 28 14:58 authz -rw-r--r-- 1 root root 309 Oct 28 14:58 passwd -rw-r--r-- 1 root root 3090 Oct 28 14:58 svnserve.conf
authz: Management is responsible for the account read and write permissions
passwd: responsible for account management and password of a user list
svnserve.conf: svn server configuration file
New users :
Open the passwd file, add user and password (final document)
Modify user permissions :
Authz open the file, the new user's privileges (final document)
[/]: Represents the root directory, i.e., / var / svnrepos
yanglp = rw: represents yanglp users have access to the root directory.
Modify the server configuration file :
Edit the file svnserve.conf
anon-access = none: express prohibition of anonymous user access.
auth-access = write: indicates authorized users have read and write permissions.
password-db = passswd: Specifies the user name password file, namely passwd file.
authz-db = authz: assign a rights profile that authz file.
realm = / var / svnrepos: Specifies the authentication domain, i.e., / var / svnrepos directory.
5, start svn service
svnserve -d -r /var/svnrepos
After a successful start, the available ps -aux to see if the service starts successfully
Second, the migration svn repository
Official Recommended:
Close all running processes and ensure that no processes can access the repository (such as httpd, svnserve or local users with direct access).
Backup repository
svnadmin dump repository address> Backup Files
Repository Recovery
svnadmin create repository name
Importing data repository
svnadmin load repository name <backup file
Method One: All library operations that is officially recommended scheme
Method Two: incremental or batch backup, batch restore, export specific reversion
svnadmin dump repos -r 23 --incremental> rev-23.dumpfile // will version23 export svnadmin dump repos -r 100: 200 --incremental> rev-100-200.dumpfile // deriving the version100 ~ 200
Batch import, these loaded with several backup files to a new repository
svnadmin load newrepos < rev-100-200.dumpfile
Finally, switch the client repository
svn switch --relocate svn://a.com/newRepo/ps svn://b.com/newRepo/ps
After we complete the server-side version of the migration, you must inform the client to run a command to switch branches, Customer commit or submit to an older version of the library to the end. SVN also prepared for us this command: svn switch.
svn switch command syntax svn switch the URL of [the PATH]
the URL of the FROM Switch --relocate the TO [the PATH] svn switch command is used to update the working copy. Meaning that points to the new repository location. First thing to note is that we can that is the whole point to the new working copy URL, also a directory under the working copy can point to the new URL.
Another important parameter is the --relocate. This parameter has a great influence whether or how to use the results, improper use and may even pose the repository is unavailable. Of which there are two important rules:
A. If the working copy is just mapped to a different location in the same version of the library, then use svn switch to
B. If the working copy is mapped to a different repository, you must use svn switch --relocate
above second rule usually occurs we need to move the entire repository to another one machine, or when different versions of the same machine in the library. This time using the original head --relocate URL refreshes the working copy of each file.