how to export groups along with roles and group members

eashwar
Tera Contributor

I am trying to export groups along with Roles and Group members to import into another instance but it doesnt import Roles and Group members.

Any suggestions ?

20 REPLIES 20

Typically, the users are already in the target instance, so the tables you need to export are as follows:


1. sys_user_group                       :Groups Listing


2. sys_user_grmember         :Group Memberships


3. sys_group_has_role         :Group Role Assignments


4. sys_user_has_role             :User Role Assignments



Let me know if you have any further questions.


Hi Chris - I am also needing to do this. Do we need to export each table, in order one by one to load the data, or is there an "easy" quick and dirty way of doing this?



Thanks!


Hi Nick,



You need to do one by one, there is no other options. But you can use URL to     export easily.



Thanks


Thank you syedfarhan so once I export from one environment using the url given above, am I able to import similarly into the other instance using url, or do I need to use import set? If I use import set, how can I remove and replace with this new info?


Typically when I export selected groups, I find the records I need from the list and export as XML. This guarantees that all of the fields are exported (not just the columns shown in the list).



You first want to export the groups themselves. Have a listing of those groups you want to export in a text file so you can copy and paste.


1.   Navigate to System Security > Groups


2.   Expand the filter and select the following filter:


      Name | is one of |


3.   In the text box on the right, paste the listing, then run the filter.


4.   Right-click in any column, then select Export > XML


5.   Save the file somewhere you can find it when you are ready to import.



Since groups contain members, the next file you export is from the sys_user_grmember table


1.   In the filter text field, type: sys_user_grmember.list


2.   Expand the filter, and from the --choose field-- dropdown, select "Show Related fields".


3.   Select "Group-->Group" fields, then select "Name".


4.   In the operator drop down, select "is one of".


5.   In the text box on the right, paste the listing, then run the filter.


6.   Right-click in any column, then select Export > XML


7.   Save the file somewhere you can find it when you are ready to import.



Since groups contain roles, the next file you export is from the sys_group_has_role table.


1.   In the filter text field, type: sys_group_has_role.list


2.   Expand the filter, and from the --choose field-- dropdown, select "Show Related fields".


3.   Select "Group-->Group" fields, then select "Name".


4.   In the operator drop down, select "is one of".


5.   In the text box on the right, paste the listing, then run the filter.


6.   Right-click in any column, then select Export > XML


7.   Save the file somewhere you can find it when you are ready to import.



Since users inherit the roles that the group has when they are added as a member, you need to export those roles they inherited from the sys_user_has_role table.


1.   In the filter text field, type: sys_user_has_role.list


2.   Expand the filter, and from the --choose field-- dropdown, select "Show Related fields".


3.   Select "Granted by-->Group" fields, then select "Name".


4.   In the operator drop down, select "is one of".


5.   In the text box on the right, paste the listing, then run the filter.


6.   Right-click in any column, then select Export > XML


7.   Save the file somewhere you can find it when you are ready to import.



When importing XML files, you will need to elevate your privileges:


1.   Click the lock icon.


2.   Click the security_admin checkbox.


3.   Click the OK button to save your changes.



Import Groups:


1.   Navigate to System Security > Groups


2.   Right-Click on the first column and select Import XML.


3.   Click the Browse... button under (1) Choose file to import


4.   Navigate to where the Export is saved.


5.   Select the file, then click the Open button.


6.   Click the Upload button under (2) Upload the file.



Import Group Memberships:


1.   In the filter text textbox, type sys_user_grmember.list


2.   Right-Click on the Group column and select Import XML.


3.   Click the Browse... button under (1) Choose file to import


4.   Navigate to where the Export is saved.


5.   Select the file, then click the Open button.


6.   Click the Upload button under (2) Upload the file.



Import Group Role Assignments:


1.   In the filter text textbox, type sys_group_has_role.list


2.   Right-Click on the Role column and select Import XML.


3.   Click the Browse... button under (1) Choose file to import


4.   Navigate to where the Export is saved.


5.   Select the file, then click the Open button.


6.   Click the Upload button under (2) Upload the file.



Import User Role Assignments:


1.   In the filter text textbox, type sys_user_has_role.list


2.   Right-Click on the Role column and select Import XML.


3.   Click the Browse... button under (1) Choose file to import


4.   Navigate to where the Export is saved.


5.   Select the file, then click the Open button.


6.   Click the Upload button under (2) Upload the file.



Let me know if you have any additional questions.