That's nice, but as soon as you need more than one user committing to that repo, it's not sufficient anymore. So, I'm migrating a single-user repository to a Debian 6 (Squeeze), using "svnserve" for future access.
So, let's assume my current repository is called "dingo" and located in the following path:
I'd like to move it to another GNU/Linux machine, but in a less user-focused location:/home/me/repositories/dingo
Create a dump file of the current (=old) repository:/srv/svn/dingo
On the old svn server, use "svnadmin dump":
Code: Select all
$ svnadmin dump /home/me/repositories/dingo > ~/svn_dump-dingo.dmp
Code: Select all
$ bzip2 -9 ~/svn_dump-dingo.dmp
Code: Select all
~/svn_dump-dingo.dmp.bz2
On the new SVN server, we'll call the user and group "svn" and create it as system account, so it will have a UID/GID below 1000:
Code: Select all
$ sudo groupadd -r svn
$ sudo useradd -c "SVN Owner" -r -g svn -d /srv/svn -M -s /bin/false svn
First, you need to create the SVN target location on the new server, and then copy the dump bz2-file:
Code: Select all
$ mkdir -p /srv/svn
$ chown svn:svn /srv/svn
You can copy the dump-file using whatever method/tool you prefer. I use "scp" (secure copy) over SSH. For example:
Code: Select all
$ scp me@old-server:~/svn_dump-dingo.dmp.bz2 /srv/svn/
Create a new, empty repository and import (=load) the dump:
Code: Select all
$ svnadmin create /srv/svn/dingo
$ cat /srv/svn/svn_dump-dingo.dmp | svnadmin load /srv/svn/dingo
NOTE: At this point, you might want to verify that your repository files in "/srv/svn/dingo" all belong to user:group "svn:svn".------- Committed revision 194 >>>
<<< Started new transaction, based on original revision 195
* adding path : scripts/storage ... done.
* adding path : scripts/storage/mkraid.sh ... done.
------- Committed revision 195 >>>
Setup SVN authentication:
In the repository folder, we've just created and filled, edit the "conf/svnserve.conf" file.
Follow the instructions of red-bean.com's SVN documentation about svnserve authentication.
In my setup, I've added the following lines to the "[global]" section in "conf/svnserve.conf":
Code: Select all
### My server settings:
password-db = passwd
realm = My own SVN realm
# anonymous users can only read the repository
anon-access = read
# authenticated users can both read and write
auth-access = write
Start the "svnserve" daemon:
Svnserve does not have an init-script on Debian (See Debian bug-report #352584)
It seems that the preferred method for running svnserve is to use "inetd".
Code: Select all
$ apt-get install inetutils-inetd
Code: Select all
$ echo "svn stream tcp nowait svn /usr/bin/svnserve svnserve -i -r /srv/svn" > /etc/inetd.d/svnserve
Code: Select all
$ service inetutils-inetd restart
Code: Select all
$ sudo svnserve -d -r /srv/svn/
Checkout your new SVN:
You should now be able to checkout your migrated repository "dingo", using the following command:
Code: Select all
$ svn checkout --username <your_user> svn://<svn_hostname>/dingo .
NOTE: This is far from perfect and clean, but it should give you a good idea about the basics for migrating an SVN repository to svnserve.
Links: