Ressources documentaires pour Mandriva Linux et les Logiciels Libres

Billets libellés svn

Importing a SVN repository from one server to another one

As now I’m using Netbeans, I had issues with key based authentication for CVS project in Netbeans. That’s why I decide to import my CVS project to SVN. At some point, as the SVN repository was on my own personal computer, I decide to move it to a public server I had, but only allow SSH access to it. So here is the procedure to move a SVN repository to another SVN server, and only allow svn+ssh access ( no webdav, no network svnserve access ) under Mandriva.

  1. On your old SVN server, you have to dump the entire SVN repository : [bash light= »1″]svnadmin dump /path/to/your/repository > /tmp/repository.svn_dump[/bash]
  2. Now copy the dump file somewhere on the new SVN server. You may want to use scp if your SSH key based authentication is working correctly. For example : [bash light= »1″]scp /tmp/repository.svn_dump user@new-svn-server:/tmp[/bash]
  3. Once done, you may want to delete the dump file on the old server and eventually delete also the old SVN repo
  4. On your new server, install the SVN server package and its associated tools : [bash light= »1″]urpmi subversion-server subversion-tools[/bash]
  5. check that svnserve is not started at boot by xinetd. For this check /etc/xinetd.d/svnserve configuration file and check that you have disable = yes as follows : [plain]# default: off
    # description: svnserve is the server part of Subversion.
    service svnserve
    disable             = yes
    port                = 3690
    socket_type         = stream
    protocol            = tcp
    wait                = no
    user                = svn
    server              = /usr/bin/svnserve
    server_args         = -i -r /var/lib/svn/repositories
  6. Now create the repository tree on the new server : [bash light= »1″]svnadmin create /var/lib/svn/repositories/[/bash]
  7. Import the dumped repository file in the new SVN repository : [bash light= »1″]svnadmin load /var/lib/svn/repositories/ < /tmp/repository.svn_dump[/bash]
  8. If the importation is successful, now you should ensure that the users connecting with SSH will have write access to the repository. For this add the users to the svn group : [bash light= »1″]usermod -G svn -a user[/bash]
  9. Now add a default ACL for the group to the repository giving read, write and execute ( rwX ) rights to all members of the svn group : [bash light= »1″]setfacl -R -m d:g:svn:rwX /var/lib/svn/repositories/[/bash]
  10. Check that from a remote computer you can list the content of the repository : [bash light= »1″]svn list svn+ssh://user@new-svn-server/var/lib/svn/repositories[/bash]

Happy coding with Subversion 🙂

Ressources :


My Tweets