How-to: Rename a User

Howto Rename a User

One of your users has changed name (ie because of a marriage) and you want to rename the users account to reflect this change.

Environment

This will cover only UCS components. With additional apps like Owncloud or Kopano there might be additional steps not documented here.

Step 0

As always, perform a backup!

Step 1

Make sure the user is logged off from every service. For IMAP you might use the command:
doveadm kick <email-address>.

Step 2

Stop postfix if running to prevent the delivery of mails to the old user name.
systemctl stop postfix

Step 3

Migrate user data to the new location.

mv /home/username_old /home/username_new
mv /data/var/spool/dovecot/private/domain/username_old /data/var/spool/dovecot/private/domain/username_new

Step 4

Rename the user in UMC and change all needed attributes:

  • username
  • Windows home directory
  • profile directory
  • internal mail address

Step 5

Start Postfix
systemctl start postfix

Mastodon