|
| 1 | +# Migrating from Duende to SimpleIdServer |
| 2 | + |
| 3 | +If you're currently using Duende IdentityServer version 7, migrating to SimpleIdServer is a smooth and straightforward process. |
| 4 | +With the help of our migration tool, you can quickly transition your identity server without hassle. |
| 5 | + |
| 6 | +## How to Migrate |
| 7 | + |
| 8 | +To begin the migration, you will need to install the `SimpleIdServer.IdServer.Migrations.Duende` NuGet package on your identity server. |
| 9 | +This package provides the necessary tools to facilitate the migration from Duende to SimpleIdServer. |
| 10 | + |
| 11 | +```cmd title="cmd.exe" |
| 12 | +dotnet add package SimpleIdServer.IdServer.Migrations.Duende |
| 13 | +``` |
| 14 | + |
| 15 | +Once the NuGet package is installed, follow these steps to configure your migration: |
| 16 | + |
| 17 | +Edit the Program.cs file; Add two essential functions: |
| 18 | + |
| 19 | +* **EnableMigration**: This function registers the dependencies needed to execute the migration. |
| 20 | + |
| 21 | +* **AddDuendeMigration** : This function registers the dependencies for migrating data from a Duende database to a SimpleIdServer database. It takes a lambda expression as a parameter, where you can specify the database connection string. |
| 22 | + |
| 23 | +Here's an example of how to configure the migration: |
| 24 | + |
| 25 | +```csharp title="Program.cs" |
| 26 | +builder.AddSidIdentityServer() |
| 27 | + .EnableMigration() |
| 28 | + .AddDuendeMigration(a => |
| 29 | + { |
| 30 | + a.UseSqlServer(""); // Add your connection string here |
| 31 | + }); |
| 32 | +``` |
| 33 | + |
| 34 | +## Running the Migration |
| 35 | + |
| 36 | +Once the migration is set up, you can execute it in two ways: |
| 37 | + |
| 38 | +1. **Manual Execution via Admin Portal**: You can trigger the migration manually by navigating to the `Migrations` tab in the administration portal of your identity server. |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | +2. **Automatic Execution on Server Startup**: If you want the migration to run automatically when the identity server starts, you can call the `LaunchMigration` function. This function takes a parameter, the realm, which determines where the data will be migrated. By default, this value is set to `master`. |
| 43 | + |
| 44 | +Example : |
| 45 | + |
| 46 | +```csharp title="Program.cs" |
| 47 | +app.Services.LaunchMigration(); |
| 48 | +``` |
| 49 | + |
| 50 | +## Entities Migrated |
| 51 | + |
| 52 | +The following entities will be migrated from Duende IdentityServer to SimpleIdServer: |
| 53 | + |
| 54 | +| Duende Entity | SimpleIdServer Entity | |
| 55 | +| ----------------- | --------------------- | |
| 56 | +| ApiScopes | Scope | |
| 57 | +| IdentityResources | Scope | |
| 58 | +| ApiResource | ApiResource | |
| 59 | +| Client | Client | |
| 60 | +| Groups | Groups | |
| 61 | +| Users | Users | |
| 62 | + |
| 63 | +With this migration process, your identity server's data is transferred seamlessly to SimpleIdServer, ensuring minimal disruption and a smooth transition. |
0 commit comments