Server Administration & Management

How to Backup & Restore SVN Server

1. Create SVN Repository

# svnadmin create /path/to/reponame

2. Backup SVN Repository

# svnadmin dump /path/to/reponame > /backup/reponame.dump

3. If your svn repo is too large, you can use gzip to compress it during the backup:-

# svnadmin dump /path/to/reponame | gzip > reponame.dump.gz

4. To extract gzip file, use the command below:-

# gunzip reponame.svndump.gz


SVN through SSH will transfer your files in encrypted format over the network. If u using remote svn server then you can use svn over ssh.
By using SVN through SSH, you can avoid others from reading your source code. To SVN through SSH in Linux or Mac, follow the steps below:-

1. Start your terminal, Use the command below to checkout from the svn through ssh :-

# svn co svn+ssh://username@mysvnserver.com//home/svn/reponame /your/dest/folder

Note:- you need to change the above command variable to yours (eg. username, mysvnserver.com, repo directory and destination folder)
Once checkout, whenever you commit changes, the svn will be through ssh.

September 14, 2011 Posted by | SVN | , , | Leave a comment