> For the complete documentation index, see [llms.txt](https://help.security.gallagher.com/knowledge-hub/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.security.gallagher.com/knowledge-hub/configuration-client/site-installation/server-properties/card-security/mifare-desfire-key-migration.md).

# MIFARE DESFire Key Migration

### Introduction

Sites may want to change their card key if their current key is easily identifiable, (e.g. default key seed), or if the key is compromised. Keys may be migrated:

* per cardholder during normal card use, or
* by an admin bulk-migrating cards by badging them

This procedure describes how a site can migrate away from using the default MIFARE® Site Key on DESFire® cards to using a unique MIFARE® Site Key.

**Notes:**

* Further information is available in the **Migrating keys on MIFARE DESFire cards TIP.pdf**, located in the `'Documentation'` folder of the Command Centre installation files.
* If you need to identify cardholders with unmigrated cards following a Key Migration, see [Identifying unmigrated cardholders after Key Migration](https://help.security.gallagher.com/knowledge-hub/configuration-client/site-installation/server-properties/card-security/identifying-unmigrated-cardholders-after-key-migration.md) for the further detail.

### Procedure

1. Generate a custom key seed or import a key and set the migration period, then **Apply** the changes.

   See the "Generate a custom key seed or import a key" part of [Card Security](https://help.security.gallagher.com/knowledge-hub/configuration-client/site-installation/server-properties/card-security.md) for the procedure.
2. Does a warning message display indicating the site has Cardax IV readers?

   If **no**, go to Step 3.

   If **yes**, cards migrated to a custom key are only compatible with HBUS readers and will not work on Cardax IV.

   Do you want to continue?

   <table><thead><tr><th width="85">If...</th><th>then...</th></tr></thead><tbody><tr><td>no,</td><td>click <strong>No</strong>, and do NOT apply changes.<br>Key migration is cancelled and the settings return to the default.</td></tr><tr><td>yes,</td><td>click <strong>Yes</strong>, and apply the changes.<br><br><strong>Note:</strong> Cards that migrate from the original key will not work on Cardax IV readers.<br>Migration to the new key initiates, and the following message displays:<br><em>"The MIFARE Plus/DESFire key seed has been updated. Any DESFire cards using the old key will migrate to the new key when they are used at an HBUS reader."</em><br><img src="https://3000903572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfCvaxj3suxNBzdwQndVT%2Fuploads%2Fgit-blob-58bac7c4c0ce07a6ada0b1a803a3171d0cafb982%2Fcardsecuritytab_pause%26stopmigration.png?alt=media" alt="SP_Card Security"></td></tr></tbody></table>
3. You can **Stop** or **Pause** the migration if necessary, (e.g. you may want to **Stop** migration if enough cards have been migrated, or **Pause** migration if you are having technical difficulties).

   <table><thead><tr><th width="166">If you click the...</th><th>then...</th></tr></thead><tbody><tr><td><strong>Stop</strong> button,</td><td>the following message displays:<br><img src="https://3000903572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfCvaxj3suxNBzdwQndVT%2Fuploads%2Fgit-blob-42315a19480d6d4f96afd33837f7ac289578a89c%2Fcardsecuritytab_stopmessage.png?alt=media" alt="SP_Card Security"><br>Do you want to continue?<br>If <strong>no</strong>, click <strong>Cancel</strong>.<br>If <strong>yes</strong>, click <strong>OK</strong>. Migration is stopped.</td></tr><tr><td><strong>Pause</strong> button,</td><td>migration is paused and the following message displays:<br><img src="https://3000903572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfCvaxj3suxNBzdwQndVT%2Fuploads%2Fgit-blob-4f25e5f72c21b6d9b61285aa130e87510ad5800a%2Fcardsecuritytab_pausemessage.png?alt=media" alt="SP_Card Security"><br>Do you want to continue?<br>If <strong>no</strong>, click <strong>Cancel</strong>.<br>If <strong>yes</strong>, click <strong>OK</strong>. Migration is paused. Both migrated and non-migrated DESFire cards will work on connected HBUS readers. No cards will have their keys migrated while migration is paused.</td></tr></tbody></table>

   The **Stop** and **Pause** buttons are replaced with a **Restart** button which can be used to migrate more DESFire cards.

   ![](https://3000903572-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfCvaxj3suxNBzdwQndVT%2Fuploads%2Fgit-blob-35ec32c0e5f9b12bb421ecf92783adc5ecaf1fc3%2Fcardsecuritytab_restartmigration.png?alt=media)
4. Click the **Restart** button to continue migrating more DESFire cards.

   **Note:** If you had changed the expiry date of the migration period from the default, when you **Restart** the migration the date will return to the default date.
5. Click the **Apply** button.

### Result

The site has migrated away from using the default MIFARE® Site Key on DESFire® cards to using a new unique MIFARE® Plus/DESFire Key Seed.

**Note:** Once the migration period ends, MIFARE Plus® and un-migrated DESFire® cards will be denied access.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.security.gallagher.com/knowledge-hub/configuration-client/site-installation/server-properties/card-security/mifare-desfire-key-migration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
