This page last changed on Jun 02, 2008 by rhartono.
A username is the name used to login to Confluence, eg. jsmith. There is no support for changing a username via Confluence yet, but you can to vote towards a feature request to allow usernames to be changed from the web interface.
Instructions For Changing Usernames
 | The following SQL commands are only tested for MYSQL and POSTGRES Databases. If you have any other database please contact your DBA to determine the equivalent queries. |
Usernames can only be changed through direct update to the Confluence database.
- If you have a database administrator, request that they approve the database-related steps described below
- If you are using JIRA user management, Revert from JIRA To Internal User Management
- Backup Confluence
- Creating a usermigration table:
create table usermigration
(
oldusername varchar,
newusername varchar
)
- Usernames that will be changed must be placed in the usermigration table with their current and planned usernames:
insert into usermigration (oldusername, newusername)
values ('oldusername', 'newusername');
- If your DB administration tool does not support multiple SQL queries, these must be entered individually.
update attachments
set creator = newusername from usermigration u
where creator = u.oldusername;
update attachments
set lastmodifier = newusername from usermigration u
where lastmodifier = u.oldusername;
update content
set lastmodifier = newusername from usermigration u
where lastmodifier = u.oldusername;
update content
set creator = newusername from usermigration u
where creator = u.oldusername;
update content
set username = newusername from usermigration u
where username = u.oldusername;
update extrnlnks
set creator = newusername from usermigration u
where creator = u.oldusername;
update extrnlnks
set lastmodifier = newusername from usermigration u
where lastmodifier = u.oldusername;
update links
set lastmodifier = newusername from usermigration u
where lastmodifier = u.oldusername;
update links
set creator = newusername from usermigration u
where creator = u.oldusername;
update notifications
set lastmodifier = newusername from usermigration u
where lastmodifier = u.oldusername;
update notifications
set creator = newusername from usermigration u
where creator = u.oldusername;
update pagetemplates
set lastmodifier = newusername from usermigration u
where lastmodifier = u.oldusername;
update pagetemplates
set creator = newusername from usermigration u
where creator = u.oldusername;
update spaces
set creator = newusername from usermigration u
where creator = u.oldusername;
update spaces
set lastmodifier = newusername from usermigration u
where lastmodifier = u.oldusername;
update spacepermissions
set permusername = newusername from usermigration u
where permusername = u.oldusername;
update spacepermissions
set creator = newusername from usermigration u
where creator = u.oldusername;
update spacepermissions
set lastmodifier = newusername from usermigration u
where lastmodifier = u.oldusername;
update contentlock
set creator = newusername from usermigration u
where creator = u.oldusername;
update contentlock
set lastmodifier = newusername from usermigration u
where lastmodifier = u.oldusername;
update os_user
set username = newusername from usermigration u
where username = u.oldusername;
update trackbacklinks
set creator = newusername from usermigration u
where creator = u.oldusername;
update trackbacklinks
set lastmodifier = newusername from usermigration u
where lastmodifier = u.oldusername;
- If using Confluence 2.1 or newer, run the following command:
update users
set name = newusername from usermigration u
where name = u.oldusername;
- Reassign personal spaces associated with the old username to the new username. The tilda (~) is required as it is prepended to the space key of all personal spaces.
update spaces
set spacekey = '~newusername'
where spacekey = '~oldusername';
- Each username is associated with a full name. For example, username 'jsmith' may have a full name of 'John M Smith'. If this fullname needs to be changed, modify the fullname in the users or os_user table.
All old usernames in Confluence should now be replaced with the new usernames from the usermigration table.
RELATED TOPICS
 
|