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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

345 views 20 10
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you