Subversion

Backup your old Repository

svnadmin dump /path/to/repository > repo_name.svn_dump

Import your old repository into the new one

svnadmin load /path/to/repository < repo_name.svn_dump

Installation

# Install required packages
$ sudo apt-get install subversion libapache2-svn

# Create subversion repositories:
sudo mkdir /var/svn
sudo chown -R www-data:www-data /var/svn





# Edit the DAV_SVN Configuration
$ sudo nano /etc/apache2/mods-available/dav_svn.conf

It should look somethink like this (the dav_svn.conf file that is)

# IMPORTANT!
# remove the # in front of the <location and </location
<Location /svn>
DAV svn
SVNParentPath /var/svn
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/dav_svn.passwd
Require valid-user
#SSLRequireSSL      # this line must be added if you want SSL enabled
</Location>

Let’s set up the Apache-server mod and create a repository

# Enable modules and restart 

$ sudo a2enmod dav_svn
$ sudo /etc/init.d/apache2 restart

# Create/enable a user account for dav_svn (the -c indicates the main user)
# Replace user1 with the adminname
$ sudo htpasswd -c /etc/apache2/dav_svn.passwd user1

# Next user2, user3, user4 etc...
$ sudo htpasswd /etc/apache2/dav_svn.passwd user2

# Testing
$ sudo svnadmin create /var/svn/test
$ sudo chown -R www-data:www-data /var/svn/test

# Testing (first enter local user password, then your svn user/pass)
$ svn co http://localhost/svn/test

To create new repositories just login and type

$ sudo svnadmin create /var/svn/myrepository
$ sudo chown -R www-data:www-data /var/svn/myrepository

To connect to your svn, simply type http://yourserverurl/svn/myrepository

Moving a Subversion Repository to Another Server
Setup a subversion (svn) server in Debian