It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

User rename in Confluence

Hi,

I'm trying to rename users in confluence4.2 with the below updates and it doesn't seems to be working.

Though it renamed the user (over user search from UI), when I click on the username I have an error

org.apache.velocity.exception.MethodInvocationException: 
Invocation of method 'canRemove' in class com.atlassian.confluence.user.actions.ViewUserAction threw exception java.lang.NullPointerException at /admin/users/viewuser.vm[line 141, column 42]

Please help in fixing

update attachments atach set atach.creator = c1_rec.newusername WHERE atach.creator = c1_rec.oldusername;
update attachments atach set atach.lastmodifier = c1_rec.newusername where atach.lastmodifier = c1_rec.oldusername;
update content atach set atach.creator = c1_rec.newusername WHERE atach.creator = c1_rec.oldusername;
update content atach set atach.lastmodifier = c1_rec.newusername where atach.lastmodifier = c1_rec.oldusername;
update content atach set atach.username = c1_rec.newusername where atach.username = c1_rec.oldusername;
update content_label atach set atach.owner = c1_rec.newusername where atach.owner = c1_rec.oldusername;
update content_perm atach set atach.creator = c1_rec.newusername where atach.creator = c1_rec.oldusername;
update content_perm atach set atach.lastmodifier = c1_rec.newusername where atach.lastmodifier = c1_rec.oldusername;
update content_perm atach set atach.username = c1_rec.newusername where atach.username = c1_rec.oldusername;
update cwd_user atach set atach.lower_user_name = c1_rec.newusername where atach.lower_user_name = c1_rec.oldusername;
update cwd_user atach set atach.user_name = c1_rec.newusername where atach.user_name = c1_rec.oldusername;
update extrnlnks atach set atach.creator = c1_rec.newusername where atach.creator = c1_rec.oldusername;
update extrnlnks atach set atach.lastmodifier = c1_rec.newusername where atach.lastmodifier = c1_rec.oldusername;
update follow_connections atach set atach.followee = c1_rec.newusername where atach.followee = c1_rec.oldusername;
update follow_connections atach set atach.follower = c1_rec.newusername where atach.follower = c1_rec.oldusername;
update label atach set atach.owner = c1_rec.newusername where atach.owner = c1_rec.oldusername;
update links atach set atach.creator = c1_rec.newusername where atach.creator = c1_rec.oldusername;
update links atach set atach.lastmodifier = c1_rec.newusername where atach.lastmodifier = c1_rec.oldusername;
update notifications atach set atach.creator = c1_rec.newusername where atach.creator = c1_rec.oldusername;
update notifications atach set atach.lastmodifier = c1_rec.newusername where atach.lastmodifier = c1_rec.oldusername;
update notifications atach set atach.username = c1_rec.newusername where atach.username = c1_rec.oldusername;
update pagetemplates atach set atach.creator = c1_rec.newusername where atach.creator = c1_rec.oldusername;
update pagetemplates atach set atach.lastmodifier = c1_rec.newusername where atach.lastmodifier = c1_rec.oldusername;
update remembermetoken atach set atach.username = c1_rec.newusername where atach.username = c1_rec.oldusername;
update spacegroups atach set atach.creator = c1_rec.newusername where atach.creator = c1_rec.oldusername;
update spacegroups atach set atach.lastmodifier = c1_rec.newusername where atach.lastmodifier = c1_rec.oldusername;
update spacepermissions atach set atach.creator = c1_rec.newusername where atach.creator = c1_rec.oldusername;
update spacepermissions atach set atach.lastmodifier = c1_rec.newusername where atach.lastmodifier = c1_rec.oldusername;
update spacepermissions atach set atach.permusername = c1_rec.newusername where atach.permusername = c1_rec.oldusername;
update spaces atach set atach.spacename = '~' || c1_rec.newusername where atach.spacename = '~' || c1_rec.oldusername;
update spaces atach set atach.creator = c1_rec.newusername where atach.creator = c1_rec.oldusername;
update trackbacklinks atach set atach.creator = c1_rec.newusername where atach.creator = c1_rec.oldusername;
update trackbacklinks atach set atach.lastmodifier = c1_rec.newusername where atach.lastmodifier = c1_rec.oldusername;
update os_propertyentry atach set atach.entity_name = 'CWD_' || c1_rec.newusername where atach.entity_name = 'CWD_' || c1_rec.oldusername;
update spaces atach set atach.spacekey = '~' || c1_rec.newusername where atach.spacekey = '~' || c1_rec.oldusername;
update bandana atach set atach.bandanacontext = '~' || c1_rec.newusername where atach.bandanacontext = '~' || c1_rec.oldusername;
update bandana atach set atach.bandanavalue = '~' || c1_rec.newusername where atach.bandanacontext = '~' || c1_rec.oldusername;
update bandana atach set atach.bandanavalue = replace(bandanavalue, '~' || c1_rec.oldusername, '~' || c1_rec.newusername);
update bodycontent atach set atach.body = replace(body, '~' || c1_rec.oldusername, '~' || c1_rec.newusername);

1 answer

Not sure how you did a username changing, but this doco might help: https://confluence.atlassian.com/display/DOC/Changing+Usernames

I went through the doc and covered all the tables listed under MySql script. I have made the changes to run for Oracle11g. Pls, help in fixing this

I got the script working when I have added Lower for usernames.

Thanks for the help

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Confluence

Introducing Confluence Cloud and Jira Software Cloud Premium

Wherever you are in your team’s journey , our goal is to support your big ambitions. We’re a cloud-first company with the mission of unleashing the potential of every team, and to address the range ...

612 views 4 17
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you