# Duende IdentityServer v5.0 to v5.1

This upgrade guide covers upgrading from Duende IdentityServer v5.0 to v5.1 ([release notes](https://github.com/DuendeSoftware/products/releases/tag/is%2F5.1.0)). Fortunately thereâs not much to do :)

## Step 1: Update NuGet package

[Section titled âStep 1: Update NuGet packageâ](#step-1-update-nuget-package)

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

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

would change to:

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

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

[Section titled âStep 2: Update Database Schema (if needed)â](#step-2-update-database-schema-if-needed)

If you are using the `Duende.IdentityServer.EntityFramework` package as the implementation for the database for your operational data, then there is a small database schema update. This includes:

* A new index on the `ConsumedTime` column in the `PersistedGrants` table ([more details](https://github.com/DuendeSoftware/products/pull/84)).

If youâre using EntityFramework Core migrations as the mechanism for managing schema changes over time, the commands below will update those migrations with the new changes. Note that you might need to adjust based on your specific organization of the migration files.

Terminal

```bash
dotnet ef migrations add Update_DuendeIdentityServer_v5_1 -c PersistedGrantDbContext -o Data/Migrations/IdentityServer/PersistedGrantDb
```

Then to apply those changes to your database:

Terminal

```bash
dotnet ef database update -c PersistedGrantDbContext
```

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.

## Step 3: Done!

[Section titled âStep 3: Done!â](#step-3-done)

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