Setup
Code Block |
---|
sudo apt-get install subversion |
...
Code Block |
---|
|
sudo usermod -a -G subversion serveradmin |
Creating Repositories
First go to or create the directory you want to create the repositories in for this example we've created the svn-repos directory in /opt/,
...
Code Block |
---|
|
su - serveradmin
svnadmin create --fs-type fsfs /opt/svn-data/hamsters |
Setting
...
Permissions on the Repository for WebDAV
After the repository is created, in order for the WebDAV process to work with the repository you need to change the permissions,
Code Block |
---|
|
cd /opt/svn-data
sudo chown -R www-data:subversion hamsters
sudo chmod -R g+rws hamsters |
Backup and Restore Commands
Checks the number of revisions in a repository
Code Block |
---|
|
svnlook info hamsters |
Dumps all revisions of the repository into a file in this case hamstersdumpfile
Code Block |
---|
|
svnadmin dump /opt/svn-repos/hamsters > hamstersdumpfile |
Dumps all revisions of the repository into a file in this case hamstersdumpfilea revision # that you decide. The other command dumps a range of revisions that you choose.
Code Block |
---|
|
svnadmin dump hamsters -r # > hamsters.rev.#.dumpfile
svnadmin dump hamsters -r 50:100 > hamsters.revs.50-100.dumpfile |
Dumps a revision # that you decide. The other command dumps a range of revisions that you choose.Loads repository from dump file.
Code Block |
---|
|
svnadmin load /opt/svn-repos/gerbils < hamstersdumpfile |
Loads repository from dump file
Setting Permissions on the Repository for WEBDAV
Similar to creating a repository permissions must also be set,
Code Block |
---|
|
cd /opt/svn-data
sudo chown -R www-data:subversion gerbils
sudo chmod -R g+rws gerbils |
Universally Unique Identifiers
Universally Unique Identifiers or UUID verifies the identity of a repository. Usually a unique UUID for each repository is desired except for situations between two repositories that is under migration of data. Using the same UUID will ensure a perfect replica of the repository being replaced and users connecting to it won't see a different repository.
First check the old repository UUID.
Code Block |
---|
|
svnlook uuid /opt/svn-data/hamsters |
As an example the output should look something like
693708d0-288a-4d90-aadb-1524a6fdba94
Then replace the new repository uuid...
Code Block |
---|
|
svnadmin setuuid /opt/svn-data/hamsters \ |
...
Warning |
---|
Still to write is an entry on UUID when restoring from a shadow repository. |
Warning |
---|
There should be instructions here... if using a shadow strategy, to record the UUID of the main repository in case you lose it. |
References
http://svnbook.red-bean.com/en/1.4/svn.intro.whatis.html
http://www.howtoforge.com/debian_subversion_websvn - Debian instructions more straight forward
http://confluence.atlassian.com/display/CROWD/Integrating+Crowd+with+Subversion - Integrating with Crowd
http://svnbook.red-bean.com/nightly/en/svn-book.html#svn.reposadmin.maint.migrate - Indepth explanation on migrating repositories