Is it possible to Migrate user groups from 1 directory to another?

Hi,

We currently have 2 directories under confluence (Confluence-Internal and Work-Internal). We are using Oracle db.

We plan to move the Work-Internal Directory up and make it the primary one. Since there are common users in both directories, we need to transfer the groups the users are a part of from the Confluence-Internal to the Work-Internal Directory.

Is there any way we could achieve this for Oracle db?

Thanks!

4 answers

1 accepted

You can user userAccessor API

Group gp = userAccessor.getGroup("confluence-users");

User addUser = userAccessor.getUser(employeeString);

if(null != addUser)

{

userAccessor.addMembership(gp, addUser);

}

Thanks :)

Do we need to specify any admin access for to script to run successfully?

yes.

User adminuser = userAccessor.getUser("xxxxx");//any admin user from confluence-admin

AuthenticatedUserThreadLocal.setUser(adminuser);

Are there any Confluence apis that we could use to change a user's group?

Do you want to add/remove people from groups?

Yes, I want to add people to groups. I need to add 1100+ people a particular group, and I am hoping there is an api which will make my task easier.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

1,035 views 23 13
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