# Live Project Data Migration UI

1. [Step By Step Process](#id-1.-step-by-step-process)
2. [Demo Video](#id-2.-demo-video)

## 1. Step By Step Process

## 1. Exporting Policy Data

Data migration feature allows transfer of some or all policy artefacts and/or state into another policy (on the same of different Guardian instance) by exporting into and then importing the .data file.

To perform export press ‘**Export policy data**’ option in the Policy menu.

The operation is available for dry-run and published policies.

<figure><img src="https://501642358-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbKnJV8vV7zUxRwKIsJKg%2Fuploads%2Fgit-blob-3e92494e78c58cee9591e10495009f6afe17b3a9%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

## 2. Importing/Exporting Keys for Dry Run Policies

To export/import virtual users’ keys and DID documents for dry-run policies press the corresponding ‘**Export virtual keys**’ or ‘**Import virtual keys**’ menu options.

They can be imported into another dry-run policy, where data was migrated from the current policy.

<figure><img src="https://501642358-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbKnJV8vV7zUxRwKIsJKg%2Fuploads%2Fgit-blob-3e92494e78c58cee9591e10495009f6afe17b3a9%2Fimage%20(593).png?alt=media" alt=""><figcaption></figcaption></figure>

## 3. Migrating Policy State to Destination Policy

If Policy state flag is set in the ‘**Migrate Data**’ dialog, the entire policy state gets migrated into the destination policy.

This includes block states - steps, timers, multi-signs, split documents, aggregate documents, etc...

To get information about different steps in the below migration process screen, please refer to [Migration Process](https://dev.guardian.hedera.com/guardian/standard-registry/discontinuing-policy-workflow/apis-related-to-discontinuing-policy-workflow/migratepolicy-data)

<figure><img src="https://501642358-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbKnJV8vV7zUxRwKIsJKg%2Fuploads%2Fgit-blob-c37510e9d44a4327fab5e6170b3c0723227db896%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

## 4. Migrate Retire Pools

When ‘Migrate retire pools’ flag is selected, the migration process will re-create all selected existing retirement pools, from all contracts created by the ‘current’ instance, in the new retirement contract. The UI allows the user to map policy tokens and select the new retire contract.

<figure><img src="https://501642358-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbKnJV8vV7zUxRwKIsJKg%2Fuploads%2Fgit-blob-1587730b844adf8b8644982420472cefe8985de5%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

## 5. Change VC Document during Migration

We have added ability to change VC which will be migrated by clicking on "**Edit document**" button under operations column:

<figure><img src="https://501642358-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbKnJV8vV7zUxRwKIsJKg%2Fuploads%2Fgit-blob-eec86a55f3e0261231a7f011acac66dc3b180f2b%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://501642358-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbKnJV8vV7zUxRwKIsJKg%2Fuploads%2Fgit-blob-2110181d74b967e33d41583743f3a03465dfaa0e%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

When state migration is selected block mapping could be used to optimize the migrations.

<figure><img src="https://501642358-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbKnJV8vV7zUxRwKIsJKg%2Fuploads%2Fgit-blob-6be67cfb99683ffd6e7ad5dd36bb6c935b1084df%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

For Policies with dynamic tokens mapping of token templates might be required.

<figure><img src="https://501642358-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbKnJV8vV7zUxRwKIsJKg%2Fuploads%2Fgit-blob-f09b0e8899001c53e4ec2ab2e233133c0ef6c6a7%2Fimage%20(602).png?alt=media" alt=""><figcaption></figcaption></figure>

## 2. Demo Video

[Youtube](https://youtu.be/stSudc82pZU?si=Nsv6RyM6I_NpRvwE\&t=110)
