Open Closed

Migrating existing User / Orginisation table to ABP/IdS #891

dmeagor created
  • ABP Framework version: 4.2
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Seperated (Angular): yes


Import and consolidate the approx 250,000 users, from two different services (each has it's own server and database) into a new Tiered ABP solution.


Our existing systems contain tables for Users and Organisations. Not all users are assigned to an organisation.

We aim to create Tenants for each user (single database multi-tenant model) based on either their organistion or individual User account if they are not part of an organisation. We are expecting to force users to reconfirm their accounts and generate new passwords (i've seen the article on passwordless logins which might help here.)


Where are the methods to manage tenants, users, orgs?

Add tenants by code: Is it possible to create new tenants, users, organisations by code? If so can you please provide snippit of code that would create a new Tenant, Organisation, and Saas Users without triggering user welcome emails, and email validation etc. I want the validation to happen when they login, and not when we import. I know it's based on the ms identity/Signinmanager/IdS stuff but I've no idea how this all ties in with the Abp tenant/org/2fa code.

Delete old tenants (GDPR) Is there a proper way to delete tenants or do we have to hard code sql?

If you think this is the wrong approach and have a better idea then please let me know. We would consider SQL but the plan was for the Abp/Identity Server solution to run in a separate datacenter.

BTW. The identity docs are little more than headings and screenshots of the UI (you should just put this info into the UI itself!) Also are there .net API docs for your repositories, methods etc? I thought I saw some once but can't seem to find any now.

1 Answer(s)
  • 0
    liangshiwei created
    Support Team


    Add tenants by code ....

    • For users, roles, you can refer :

    • For tenantns, you can use TenantAppService.CreateAsync method. it will also initialize the tenant data.

    • For organisations, you can inject IOrganizationUnitManager to create , delete ... an organisation.

    Delete old tenants

    You just need to inject Repositpry and use DeleteAsync mehtod , like