# Invoke Cache Migration when OAuth2 is Deployed

Make sure you have completed the [DCG OAuth2 Setup and Usage](/docs/industries/cme/guide/comms-t-dcg-oauth2-setup-and-usage.md) and received the credentials from Technical Support. When OAuth2 credentials are mentioned in this topic, use the `cmig` set of credentials.

If you are using ​Salesforce Industries Communications, Media, and Energy Fall '20 or later, then set the following parameter values:

| Parameter                         | Value                                                                             |
| --------------------------------- | --------------------------------------------------------------------------------- |
| CacheAPI.ExternalSystemAuthHeader | JSON with { "oauth2_server":"" , "customer_app_key":"" ,"customer_app_secret":""} |
| oauth2_server                     | OAuth2 URL                                                                        |
| customer_app_key                  | OAuth2 application key                                                            |
| customer_app_secret               | OAuth2 application secret                                                         |

For example:

`{ "oauth2_server": "vlocity-exaple.amazoncognito.com", "customer_app_key": "testKey", "customer_app_secret": "testSecret" }`

Then, add the URL to the remote site URL.

For versions Salesforce Industries Communications, Media, and Energy Summer '20 and prior, you can migrate CachedAPIResponse\_\_c records from the Salesforce platform to DCG when OAuth2 is deployed by using the:

- Command Line Interface: Obtain the OAuth2 JWT token and call GET /cm/migrate endpoint.

- GUI (this solution is valid for one hour, after which the CacheAPI.ExternalSystemAuthHeader needs to be updated again).

  - Obtain the OA uth2 JWT token.

  - Replace the CacheAPI.ExternalSystemAuthHeader field with the Bearer token value (oauth2\_jwt_token_value).

  - Make the API GET call.
