---
title: Step 2. User Data Migration
sidebar:
  order: 3
---

Once your user accounts have been migrated over to SuperTokens, additional information like metadata, roles and permissions can be associated with the user.

## User Metadata Migration

SuperTokens allows you to store arbitrary data that is JSON serializable against a userId.

In this example we want to store the following metadata against our user:

```json
{
  "someKey": "someValue"
}
```

```bash
curl --location --request PUT '<CORE_API_ENDPOINT>/recipe/user/metadata' \
--header 'api-key: <YOUR_API_KEY>' \
--header 'Content-Type: application/json; charset=utf-8' \
--data-raw '{
  "userId": "5acb2dbc-04f0-4c80-822a-7f06cd658f6f",
  "metadataUpdate": {
    "someKey": "someValue"
  }
}'
```

## User Roles Migration

SuperTokens allows you to assign roles and permissions to a userId.

In this example we will be assigning the `admin` role to a user:

```bash
curl --location --request PUT '<CORE_API_ENDPOINT>/recipe/user/role' \
--header 'api-key: <YOUR_API_KEY>' \
--header 'Content-Type: application/json; charset=utf-8' \
--data-raw '{
  "role": "admin",
  "userId": "5acb2dbc-04f0-4c80-822a-7f06cd658f6f"

}'
```

:::info[Important]
Roles and permissions must be created before they can be assigned to a user. You can follow this [guide](/additional-verification/user-roles/initial-setup) on creating roles and permissions in SuperTokens.
:::

---

## See also

<CardGroup cols={3}>
  <Card title="Account Creation" href="/migration/legacy/account-creation/user-creation" />
  <Card title="Session Migration" href="/migration/legacy/session-migration" />
  <Card title="MFA Migration" href="/migration/legacy/mfa-migration" />
  <Card title="Email Verification" href="/migration/legacy/account-creation/email-verification" />
  <Card title="User Metadata" href="/post-authentication/user-management/user-metadata" />
</CardGroup>
