Thursday, June 4, 2009

Migrate or roll back an entire svn repository

If you have suddenly been stuck doing a stupid commit to svn and don't know how to just get back, here is a quick hack which I found at http://stackoverflow.com/questions/402159/roll-back-or-revert-entire-svn-repository-to-an-older-revision.


svnadmin create --fs-type fsfs /svnroot/<repo>.fixed
svnadmin dump -r 1:24 /svnroot/<repo> --incremental > dump.svn 
svnadmin load /svnroot/<repo>.fixed < dump.svn
 
The next step, as you might have guessed, is to move the repo.fixed to . This way, you can also copy a repository as it is to someplace else by just doing the load into some other server somewhere.

No comments:

Post a Comment