Feature #109

Create a script which renames the usernames in an existing SVN repository

Added by Robert Lemke over 13 years ago. Updated over 10 years ago.

Should have
Target version:
Start date:
Due date:
% Done:


Estimated time:


If we want to transfer the 4.x SVN repository from Source Forge one day, we'll need to map all the typo3.org user names to those which were used at SF. One way would be to svnadmin dump the whole repository, do some fancy search & replace of usernames according to a mapping table and then svnadmin load the hacked dump.

We need to find out if that is possible and then create a script which does that.


Updated by Sebastian Kurfuerst over 13 years ago

  • % Done changed from 0 to 10


Gosh, that sounds cumbebrsome to me. It would take the repository  
offline, in any case. If you can do that, fine, but a less-invasive  
solution would be to simply set a pre-revprop-change hook to allow  
changes to revision properties, then just "svn propset svn:author  
$NEW_AUTHOR -r $REV $REPO" for each $REV that was committed by this  
author. Something like "svn log $REPO | grep $OLD_AUTHOR" can show  
you which revisions those are.


Updated by Sebastian Kurfuerst over 13 years ago


    Because Subversion's revision properties are not versioned, making modifications to such a property (for example, the svn:log commit message property) will overwrite the previous value of that property forever. Since data can be potentially lost here, Subversion supplies this hook (and its counterpart, post-revprop-change) so that repository administrators can keep records of changes to these items using some external means if they so desire. As a precaution against losing unversioned property data, Subversion clients will not be allowed to remotely modify revision properties at all unless this hook is implemented for your repository.

    This hook runs just before such a modification is made to the repository. The repository passes four arguments to this hook: the path to the repository, the revision on which the to-be-modified property exists, the authenticated username of the person making the change, and the name of the property itself.

(from Subversion Book)
                                                                -- remove r from revision number
for i in `svn log svn://...|grep $OLDUSER | awk '{print $1}'|sed -e 's/r//'`; do echo $i; done

outputs all revision numbers. Now we can adjust the user.


Updated by Sebastian Kurfuerst over 13 years ago

for i in `svn log svn://...|          grep "|"            |       grep line       |         grep $OLDUSER       |        awk '{print $1}'        |         sed -e 's/r//'`; do echo $i; done

Updated by Sebastian Kurfuerst over 13 years ago

  • Status changed from Accepted to Resolved
  • Target version set to 0.1
  • % Done changed from 10 to 100

Fixed. Script is created and lies under /home/forge/svn-helpers/rename-svn-users.sh


Updated by Sebastian Kurfuerst almost 13 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF