Forum Discussion

alejandro's avatar
alejandro
Cloud Apps
05-30-2024
Solved

Migrate users from one tenant to another

I want to migrate  users from one tenant to another; I exported the first tenant users as well as their related data, then I deleted the users so I can recreate those users in the second tenant, I tried to use the REST API tool to add a new user, however, I'm getting an "Error: response status is 422" message as seen in the images below:

This is the payload I'm using to recreate the user:

[
{
"_id": "665643c6367dfe002dfa9e7f",
"roleId": "5fbc47b1ded309103e86c139",
"userName": "alejandro_gran",
"firstName": "ALEJANDRO",
"lastName": "GRAN",
"email": "[email protected]",
"groups": [
"5fc300cf435a06002d5c8c25",
"5fc30117be402c002c2c9955",
"628bfc96c760f7002cd49da8",
"6137da88e5a7ed001a54935f"
],
"active": true,
"pendingExpiration": "2024-06-04T20:51:18.614Z",
"created": "2024-05-28T20:51:18.614Z",
"lastUpdated": "2024-05-28T21:06:24.121Z",
"lastLogin": "2024-05-28T21:06:24.121Z",
"activationExpires": 1717534278614,
"tenantId": "null",
"manifest": {
"tenants": {
"crossTenant": {
"allowed": false
}
}
},
"internalGroups": [
"62bb52c0a3df55001b5cbeff"
],
"preferences": {},
"lastActivity": "2024-05-28T21:06:24.055Z",
"uiSettings": {
"ecmNext": {
"dataPage": {
"hideListViewGuider": true
},
"guidersShown": {
"addData": true,
"ecActions": true,
"dashboards": true
}
}
}
}
]

  • I was able to add a user in a specific tenant using the next payload using REST API version 1.0:

    {
    "email": "[email protected]",
    "userName": "alejandro_ran",
    "firstName": "Alejandro",
    "lastName": "Ran",
    "roleId": "5fbc47b1ded309103e86c131",
    "groups": [
    "5fc300cf435a06002d5c8d65",
    "2df32132be402c002c2c9886",
    "5894da88e5a7ed001a54516f"
    ],
    "tenantId": "88620637367dfe002dfa9e80",
    "preferences": {

    },
    "uiSettings": {}
    }

5 Replies

  • I was able to add a user in a specific tenant using the next payload using REST API version 1.0:

    {
    "email": "[email protected]",
    "userName": "alejandro_ran",
    "firstName": "Alejandro",
    "lastName": "Ran",
    "roleId": "5fbc47b1ded309103e86c131",
    "groups": [
    "5fc300cf435a06002d5c8d65",
    "2df32132be402c002c2c9886",
    "5894da88e5a7ed001a54516f"
    ],
    "tenantId": "88620637367dfe002dfa9e80",
    "preferences": {

    },
    "uiSettings": {}
    }

    • alejandro's avatar
      alejandro
      Cloud Apps

      Hey DRay 

      I added my solution in this page so other people get to know what I did to solve this issue.

      • DRay's avatar
        DRay
        Admin

        Thank you! I appreciate you providing that solution, and I know other users do also!