# Migrate Subusers to EU Data Resident Subusers

Twilio designed data residency to process and store email and recipient personally identifiable information (PII) within the European Union (EU). To support this, Twilio SendGrid offers two region options: Global and EU.

As EU data residency requires subusers, it also requires a paid account.

## Migrate to EU data residency

Existing customers who want to change their global traffic to EU data resident need to migrate their subuser data to EU subusers. Twilio can't automate this process.

When you choose the EU region for a subuser, it ties that subuser to EU-based infrastructure. This makes their emails and recipient PII EU data resident. To prevent transferring data across borders, Twilio locks the subuser to the selected region once created.

### Create EU-based subusers

EU Data Residency requires one or more EU-based subusers.

1. Open the [Twilio SendGrid Console][sg-console].
2. Click **Settings**.
3. Click [**Subuser Management**][sg-subusers].
4. Click **Create a new subuser**.
5. Select **EU User** when asked to **Assign Region to Subuser**.
6. Include the region of the subuser in the name.\
   For example: write it as `Subuser1_Marketing_EU`.

To learn more about SendGrid subusers, see [Subusers][sg-subusers-docs].

[sg-console]: https://app.sendgrid.com

[sg-subusers]: https://app.sendgrid.com/settings/subusers

[sg-subusers-docs]: /docs/sendgrid/ui/account-and-settings/subusers

### Update sender authentication

You can neither export nor import sender authentication data. You can authenticate a single domain twice then use it for both global and EU sending.

To associate an authenticated domain with the European Union, follow the procedure in the [Setting up domain authentication][sg-domain-authentication] guide with two changes.

1. Open the [Twilio SendGrid Console][sg-console].
2. In the [**Advanced Settings**][sg-auth-adv] section,
   1. Select **Make domain EU pinned**.
      * If this option can't be selected, your account has no EU subusers. Add them first.
      * Once completed, the EU-pinned domains `CNAME` value includes `eu`.
   2. [Assign the EU-based domain to the subuser][sg-link-domain] under **Assign to a subuser**.

To learn about the procedures inolved in configuring authentication, see the following guides:

* [Setting up domain authentication][sg-domain-authentication]
* [Setting up reverse DNS][sg-reverse-dns]
* [Setting up link branding][sg-link-branding]

[sg-link-domain]: /docs/sendgrid/ui/account-and-settings/how-to-set-up-domain-authentication#assign-to-a-subuser

[sg-auth-adv]: /docs/sendgrid/ui/account-and-settings/how-to-set-up-domain-authentication#advanced-settings

[sg-domain-authentication]: /docs/sendgrid/ui/account-and-settings/how-to-set-up-domain-authentication

[sg-reverse-dns]: /docs/sendgrid/ui/account-and-settings/how-to-set-up-reverse-dns

[sg-link-branding]: /docs/sendgrid/ui/account-and-settings/how-to-set-up-link-branding

### Migrate unsubscribes

1. Download your unsubscribes from your previous account.

   1. Open the Twilio SendGrid Console.
   2. Go to the [**Global unsubscribes**][unsub-global] page.
   3. Click the gear dropdown menu.
   4. Click **Export CSV**.
2. Load your unsubscribes into your new account.

   1. Open the [Twilio SendGrid Console][sg-console].
   2. Click [**Global Unsubscribes**][sg-unsub-global] or [**Group Unsubscribes**][sg-unsub-group].
   3. Click the gear dropdown menu.
   4. Click **Manually Add Recipients**.
      * If you chose **Global Unsubscribes**, the **Add Global Unsubscribes** panel displays.
      * If you chose **Group Unsubscribes**, the **Add Group Unsubscribes** panel displays.
   5. Open the CSV file you downloaded in your preferred text editor.
   6. Select its contents, the exported unsubscribed emails, and copy them.
   7. Paste the exported unsubscribed emails on the **Email Addresses** line.\
      Separate each email address with a comma or a line break.
   8. Click **Add**.

   To add unsubscribes using the API, use the [Suppressions resources][sg-suppress-api].

[sg-unsub-global]: https://app.sendgrid.com/suppressions/global_unsubscribes

[sg-unsub-group]: https://app.sendgrid.com/suppressions/group_unsubscribes

[sg-suppress-api]: /docs/sendgrid/api-reference/suppressions-global-suppressions/add-recipient-addresses-to-the-global-suppression-group

[unsub-global]: https://app.sendgrid.com/suppressions/global_unsubscribes

### Migrate dynamic templates

1. Open the Twilio SendGrid Console.
2. Click **Email API**.
3. Click [**Dynamic Templates**][sg-txn-templ].
4. Export the HTML of any transactional templates you want to migrate.
5. For each template you exported, complete these steps.
   1. Open the template in your preferred HTML or text editor.
   2. Select the HTML and copy it.
   3. From the [**Dynamic Templates**][sg-txn-templ], click **Create a Dynamic Template**.\
      The **Create a Dynamic Template** pane displays.
   4. Type a name for the template in the **Dynamic Template Name** box.
   5. Click **Create**.
   6. Click on the name of the template in the list of templates.
   7. Click **Add Version**.\
      The **Select a Design** page displays.
   8. Click **Select** in the **Blank Template** box
   9. Choose to use the code editor.
   10. Paste the HTML of the exported template into the editor.
   11. Click **Save**.
   12. Click the back arrow.
   13. Repeat for every template.

[sg-txn-templ]: https://mc.sendgrid.com/dynamic-templates

### Create EU API Keys

When using the SendGrid API, your accounts list need different, EU-based API Keys.

1. [Create API Keys][sg-api-keys] for all EU subusers. You *can't* export API Keys.
2. Update your integrations with the new API Keys.

[sg-api-keys]: /docs/sendgrid/ui/account-and-settings/api-keys

### Add dedicated IPs

As described in [Dedicated IP addresses][sg-dedicated-ips], add EU IP Addresses to EU subuser accounts.

Once added, the EU IP addresses need to warm up.

To warm up the IP addresses, choose one of the following options:

* Assign the EU IP to an EU subuser then [warm up the IP][sg-ip-warmup]. Any subsequent EU IP addresses warm up as normal.
* Assign the EU IP to a global subuser with a warmed up EU or global IP address. These email addresses *can't* be EU Data Resident.

Once warmed up, move the EU IP address to an EU subuser so they can use EU data residency.

To learn more about IP warmup, check out [Warming Up an IP Address](https://www.twilio.com/docs/sendgrid/ui/sending-email/warming-up-an-ip-address#why-dont-other-esps-require-ip-warmup).

[sg-ip-warmup]: /docs/sendgrid/ui/sending-email/warming-up-an-ip-address

[sg-dedicated-ips]: /docs/sendgrid/ui/account-and-settings/dedicated-ip-addresses

### Assign EU IP Addresses to IP Pools

Assign EU IP addresses to an IP pool that contain global IP addresses. In such instances, the EU subuser can only send emails using the EU IP addresses in the pool. To send emails, you don't need to assign the IP pools to each individual subuser account.

To learn more, see [IP Pools][sg-ip-pools].

[sg-ip-pools]: /docs/sendgrid/ui/account-and-settings/ip-pools#create-an-ip-pool

### Remove previous Subusers

Once you create all EU subusers, if they assume all sending, delete the old subusers.
