1

My company's user naming schema changed and we like to apply the new naming schema on our existing Trac instance. We already added the new users, so new tickets and changes will use the new names. What's left to do is to migrate the user names for existing tickets and changes so our existing reports and statistics remain useful.

We are using trac 0.12 with sqlite as database. In principle it should be enough to take a look at the Trac database schema, find all tables with fields containing user names and issue SQL update statements. Still it probably takes a couple of hours to get everything right, so I'd rather use an existing tool than write something from scratch.

Any recommendations?

(We also need to change the user names in our Subversion repository. svndumptool seems to solve this using svndumptool transform-revprop svn:author oldname newname repo.dump newrepo.dump.)

roskakori
  • 3,139
  • 1
  • 30
  • 29

1 Answers1

3

The best place to look for tools like this is a website called Track Hacks. A quick search there turned up three potential solutions for renaming users.

  1. http://trac-hacks.org/wiki/RenameUsersScript
  2. http://trac-hacks.org/wiki/RenameTracUsersScript
  3. http://trac-hacks.org/wiki/RenameUserPlugin

I hope that one of these can help you out.

Josh Laase
  • 326
  • 1
  • 13
  • 1
    [RenameUsersScript](http://trac-hacks.org/wiki/RenameUsersScript) did the trick. It works perfectly in our environment (Linux, sqlite) though others might need a different approach when using Windows or another database. BTW `svndumptool` also works as advertised. So we smoothly managed to rename the users in both our trac.db and Subversion repository. – roskakori Mar 02 '12 at 21:54
  • Good to know. I've been planning to integrate the rename user procedure in AccountManagerPlugin, not done much so far, but at least I know of already working code. – hasienda Mar 04 '12 at 00:50