Yesterday I spent a lot of time trying to figure out how to take a complete backup of a subversion repository containing some code that I am currently working on. The generic way to do this is
svnadmin dump path-to-repos
but svnadmin only works on local repositories. However, I do not have shell access to the machine containing the repository and can only access it through its webDAV interface. I thought that since all revision information is available through the normal svn client, someone would have solved this problem nicely already. I googled around and could not find any obvious solutions. I found a the source to a program, svn-push in the subversion repository contrib section. It is a bit unclear what this program actually does and I was unable to actually make it compile. After some more searching I stumbled acroos svk which is a program build on top of subversion. Eventually I found out that I could abuse this program to create a dump of my remote repository. First make sure that you have no previous svk history:
rm -rf ~/.svk
Then get information of the repository by issuing the following command and follow the instructions on screen
svk ls [subversion-repository-URL]
svk should then have built a local repository, the first two revisions to this are local svk information, we simply dump the rest:
svnadmin dump -r2:HEAD ~/.svk/local > my-repository-dump
If you have stored the repository with the same name as you original repository as part of the “ls” command, my-repository-dump should now contain the full revision and log information of the original remote repository. yay.
-
Archives
- June 2010
- May 2010
- April 2010
- December 2009
- September 2009
- August 2009
- July 2009
- November 2008
- October 2008
- August 2008
- June 2008
- February 2008
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- June 2006
- May 2006
- April 2006
- March 2006
- February 2006
- January 2006
- November 2005
- October 2005
- August 2005
- July 2005
- May 2005
- April 2005
- March 2005
- February 2005
- January 2005
- December 2004
- October 2004
- August 2004
- July 2004
- June 2004
- May 2004
- April 2004
- March 2004
- February 2004
- January 2004
- February 2003
- January 2003
- December 2002
- August 2002
- June 2002
- May 2002
- March 2002
- January 2002
- November 2001
- October 2001
- September 2001
- August 2001
- July 2001
- June 2001
- May 2001
- April 2001
- March 2001
- February 2001
- January 2001
-
Meta
Pingback: How-to Backup / Mirror a public SVN repository at Coolkevmen
Many thanks!
It saved me from a very bugging situation which blocked my repository :-)
I had exactly the same problem and ended up writing a small command line tool on top of the Subversion API that can dump a repository by accessing it via WebDAV or the svn:// protocol.
Maybe it will be useful for others, too: http://saubue.boolsoft.org/projects/rsvndump
That is a neat solution, sounds more elegant than my approach :)
I stumbled across another approach while trying to implement yours.
~$ svnsync help initialize
initialize (init): usage: svnsync initialize DEST_URL SOURCE_URL
Initialize a destination repository for synchronization from
another repository.
The destination URL must point to the root of a repository with
no committed revisions. The destination repository must allow
revision property changes.
If the source URL is not the root of a repository, only the
specified part of the repository will be synchronized.
You should not commit to, or make revision property changes in,
the destination repository by any method other than ‘svnsync’.
In other words, the destination repository should be a read-only
mirror of the source repository.
Valid options:
–non-interactive : do no interactive prompting
–no-auth-cache : do not cache authentication tokens
–username ARG : specify a username ARG (deprecated;
see –source-username and –sync-username)
–password ARG : specify a password ARG (deprecated;
see –source-password and –sync-password)
–trust-server-cert : accept unknown SSL server certificates without
prompting (but only with ‘–non-interactive’)
–source-username ARG : connect to source repository with username ARG
–source-password ARG : connect to source repository with password ARG
–sync-username ARG : connect to sync repository with username ARG
–sync-password ARG : connect to sync repository with password ARG
–config-dir ARG : read user configuration files from directory ARG
-q [--quiet] : print as little as possible
~$ rpm -q –whatprovides $(which svnsync)
subversion-1.6.2-1.el5.rf