You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Marko Asplund <ma...@ixonos.com> on 2012/05/24 20:54:21 UTC

Mapping users in SVN-SVN repository migration?

hi,

I need to migrate our Subversion repository to another SVN server.
The servers have different user accounts and I would need to map user
accounts used in the source repository to target repository user accounts
before importing the repository.

How do I map SVN repository users in this case?

marko

Re: Mapping users in SVN-SVN repository migration?

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Andy Levy wrote on Thu, May 24, 2012 at 15:33:16 -0400:
> On Thu, May 24, 2012 at 3:20 PM, Marko Asplund <ma...@ixonos.com> wrote:
> >
> > On Thu, May 24, 2012 at 10:05 PM, Daniel Shahaf <d....@daniel.shahaf.name>
> > wrote:
> >>
> >> ...
> >>
> >> Why do you believe you would need to "map" user accounts?  What does
> >> "map" mean?
> >
> >
> > Ok, I'll try to explain myself a bit better.
> >
> > I'm migrating a repository from SVN source server A to SVN target server B.
> > SVN server A has account U for user U, while user U's account is named T on
> > server B.
> > SVN server A has accounts that are not present on server B.
> > Target server B is centrally managed and the user management policy prevents
> > creating all the accounts found on source server A.
> >
> > For these reasons I assumed I would need to modify the source repository
> > history so that commits made by user U would be attributed to account T
> > before loading the repository data into server B.
> >
> > Am I making false assumptions here?
> 
> Subversion won't care that the names have changed (there is no
> technical requirement for you to do this at all),

That's correct, but in more words: the value of svn:author revprop is
determined at commit time as the authenticated username, but after the
commit has been done there are _no_ restrictions on the value of the
revprop.  It behaves just like every other revision property --- it can
be set to any value.

Agreeing with the remainder of Andy's advice.

Thanks,

Daniel

(Well, there is a small caveat here --- see svn_repos__validate_prop()
if you want the gory details.)

Re: Mapping users in SVN-SVN repository migration?

Posted by Marko Asplund <ma...@ixonos.com>.
On Thu, May 24, 2012 at 10:33 PM, Andy Levy <an...@gmail.com> wrote:

> ...
> Subversion won't care that the names have changed (there is no
> technical requirement for you to do this at all), but your users will
> because they have to remember that Bob is now Robert, and Susan is now
> Sue, etc. If the names are similar or easy to remember, you may not
> have to do anything.
>
> You do not have to do this at the time of migrating the repository,
> though it may be convenient to do so.
>
> If I were in your position and had to rewrite those author names, I
> would do the following:
> 0) Migrate the repository to the new server
> 1) Make sure it works
> 2) Create a mapping (lookup table) of old names to new names
> 3) Write a script to iterate through each revision from 0 through the
> last revision committed on server A and do this:
> for (X in 1...last_rev) {
> oldauthor = svn propget --revprop svn:author --revision X <URL>
> newauthor = lookupNewNameFor(oldauthor)
> svn propset svn:author  --revprop --revision X newauthor <URL>
> }
>
> where URL is the URL to the root of your repository
>

Subversion is integrated with other software development tools in our
development environment so having the authors  account names set correctly
is very important for us.

I've been testing the approach you suggested and it seems to be working
fine.
thanks!

marko

Re: Mapping users in SVN-SVN repository migration?

Posted by Andy Levy <an...@gmail.com>.
On Thu, May 24, 2012 at 3:20 PM, Marko Asplund <ma...@ixonos.com> wrote:
>
> On Thu, May 24, 2012 at 10:05 PM, Daniel Shahaf <d....@daniel.shahaf.name>
> wrote:
>>
>> ...
>>
>> Why do you believe you would need to "map" user accounts?  What does
>> "map" mean?
>
>
> Ok, I'll try to explain myself a bit better.
>
> I'm migrating a repository from SVN source server A to SVN target server B.
> SVN server A has account U for user U, while user U's account is named T on
> server B.
> SVN server A has accounts that are not present on server B.
> Target server B is centrally managed and the user management policy prevents
> creating all the accounts found on source server A.
>
> For these reasons I assumed I would need to modify the source repository
> history so that commits made by user U would be attributed to account T
> before loading the repository data into server B.
>
> Am I making false assumptions here?

Subversion won't care that the names have changed (there is no
technical requirement for you to do this at all), but your users will
because they have to remember that Bob is now Robert, and Susan is now
Sue, etc. If the names are similar or easy to remember, you may not
have to do anything.

You do not have to do this at the time of migrating the repository,
though it may be convenient to do so.

If I were in your position and had to rewrite those author names, I
would do the following:
0) Migrate the repository to the new server
1) Make sure it works
2) Create a mapping (lookup table) of old names to new names
3) Write a script to iterate through each revision from 0 through the
last revision committed on server A and do this:
for (X in 1...last_rev) {
oldauthor = svn propget --revprop svn:author --revision X <URL>
newauthor = lookupNewNameFor(oldauthor)
svn propset svn:author  --revprop --revision X newauthor <URL>
}

where URL is the URL to the root of your repository

Re: Mapping users in SVN-SVN repository migration?

Posted by Marko Asplund <ma...@ixonos.com>.
On Thu, May 24, 2012 at 10:05 PM, Daniel Shahaf <d....@daniel.shahaf.name>wrote:

> ...
> Why do you believe you would need to "map" user accounts?  What does
> "map" mean?


Ok, I'll try to explain myself a bit better.

I'm migrating a repository from SVN source server A to SVN target server B.
SVN server A has account U for user U, while user U's account is named T on
server B.
SVN server A has accounts that are not present on server B.
Target server B is centrally managed and the user management policy
prevents creating all the accounts found on source server A.

For these reasons I assumed I would need to modify the source repository
history so that commits made by user U would be attributed to account T
before loading the repository data into server B.

Am I making false assumptions here?

marko

Re: Mapping users in SVN-SVN repository migration?

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Marko Asplund wrote on Thu, May 24, 2012 at 21:54:21 +0300:
> I need to migrate our Subversion repository to another SVN server.
> The servers have different user accounts and I would need to map user

http://s.apache.org/xy-problem

Why do you believe you would need to "map" user accounts?  What does
"map" mean?

> accounts used in the source repository to target repository user accounts
> before importing the repository.