Skip to content

Commit

Permalink
First draft of v6-v7 upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
AndersAbel committed Nov 8, 2023
1 parent b6130a2 commit 4c26b8f
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions IdentityServer/v7/docs/content/upgrades/v6.3_to_v7.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
title: "Duende IdentityServer v6.3 to v7.0"
weight: 40
---

{{% notice note %}}
This upgrade guide is work in progress based on the currently available [preview version of v7.0](https://github.com/DuendeSoftware/IdentityServer/releases/tag/7.0.0-preview.1).
{{% /notice %}}

## What's New
TODO

## Step 1: Update NuGet package

In your IdentityServer host project, update the version of the NuGet package reference.
For example in your project file:

```
<PackageReference Include="Duende.IdentityServer" Version="6.2.0" />
```

would change to:

```
<PackageReference Include="Duende.IdentityServer" Version="7.0-preview.1" />
```

## Step 2: Update Database Schema (if necessary)

TODO

IdentityServer is abstracted from the data store on multiple levels, so the exact steps involved in updating your data store will depend on your implementation details.

#### Custom Store Implementations
The core of IdentityServer is written against the [store interfaces]({{<ref "reference/stores" >}}), which abstract all the implementation details of actually storing data. If your IdentityServer implementation includes a custom implementation of those stores, then you will have to determine how best to include the changes in the model in the underlying data store and make any necessary changes to schemas, if your data store requires that.

#### Duende.IdentityServer.EntityFramework
We also provide a default implementation of the stores in the *Duende.IdentityServer.EntityFramework* package, but this implementation is still highly abstracted because it is usable with any database that has an EF provider. Different database vendors have very different dialects of sql that have different syntax and type systems, so we don't provide schema changes directly. Instead, we provide the Entity Framework entities and mappings which can be used with Entity Framework's migrations feature to generate the schema updates that are needed in your database.

To generate a migration for the new columns, run the command below. Note that you might need to adjust paths based on your specific organization of the migration files.

```
dotnet ef migrations add Update_DuendeIdentityServer_v7_0_preview_1 -c ConfigurationDbContext -o Migrations/ConfigurationDb
```

Then to apply this migration to your database:

```
dotnet ef database update -c ConfigurationDbContext
```

Some organizations prefer to use other tools for managing schema changes. You're free to manage your schema however you see fit, as long as the entities can be successfully mapped. Even if you're not going to ultimately use Entity Framework migrations to manage your database changes, generating a migration can be a useful development step to get an idea of what needs to be done.

{{% notice info %}}
The ServerSideSession.Id property has been changed from `int` to `long`. For most deployments this will be handled by the EF generated migration scripts. For deployments with high volumes of sessions, high availability demands and no low traffic hours this might be a problem. The impact and possible workarounds depends on the database engine used.
{{% /notice %}}

## Step 3: Breaking changes
TODO

## Step 5: Done!

That's it. Of course, at this point you can and should test that your IdentityServer is updated and working properly.

0 comments on commit 4c26b8f

Please sign in to comment.