Renaming users

From Wikitech
  1. Rename the user in LDAP (on terbium):
    1. Find the user's current information:
      • ldaplist -l passwd <shell-account-name>
    2. Ensure the new CN doesn't conflict with another user's CN
      • ldapsearch -LLL -x -D 'cn=proxyagent,ou=profile,dc=wikimedia,dc=org' -w $(grep -Po "(?<=BINDPW).*" /etc/ldap/ldap.conf) -b 'ou=people,dc=wikimedia,dc=org' 'cn=<new-cn>'
    3. Change the user's CN
      • modify-ldap-user --cn="<new-cn>" <shell-account-name>
  2. Rename the user in Wikitech (via Special:RenameUser)
  3. Rename the user in Gerrit
    1. Connect to Gerrit's database
      • ssh -p 29418 gerrit.wikimedia.org gerrit gsql
    2. Find the user's current information
      • select * from account_external_ids where external_id like 'gerrit:<old cn>'
        (this sometimes might not be the casing you expect, hence the like)
    3. Update gerrit: entry
      • update account_external_ids set external_id = 'gerrit:<new cn>' where external_id = 'gerrit:<old cn>'
    4. Wait for caches to clear, or alternatively force clear them
      • ssh -p 29418 gerrit.wikimedia.org gerrit flush-caches --all