This topic describes how to configure Resource Access Management (RAM) authorization so that Data Transmission Service (DTS) can migrate or synchronize data from a self-managed database — connected to an Alibaba Cloud virtual private cloud (VPC) via Express Connect, VPN Gateway, or Smart Access Gateway — to a cloud database owned by a different Alibaba Cloud account.
The setup involves two accounts:
| Account | Role |
|---|---|
| Account A | Owns the Express Connect circuit and the VPC |
| Account B | Owns the destination database instance |
Account A grants Account B (and the DTS service) permission to read its VPC resources. After authorization, Account B can use DTS to run cross-account migration or synchronization tasks.
Limits
The self-managed database in the VPC can only be the source database in a cross-account DTS task. Using it as the destination is not supported.
For supported database types, see the Supported databases section in "Configure RAM authorization for cross-account DTS tasks".
Prerequisites
Before you begin, make sure that:
-
The DTS RAM role is already authorized by Account A to access its cloud resources. For more information, see Authorize DTS to access Alibaba Cloud resources.
-
You have the Account ID for both accounts. Log in to the Security Settings page with the relevant account to get the ID.
Complete all steps in this topic using the Alibaba Cloud account (root account), not a RAM user. RAM user grants cause DTS to return an invalid permissions error because DTS must call STS AssumeRole on a role principal — not a user principal.
Step 1: Create a RAM role and grant the DTS default permission
All steps in this section are performed in Account A (the Express Connect circuit owner).
-
Log in to the RAM console using Account A.
-
In the left-side navigation pane, choose Identities > Roles.
ImportantDo not choose Identities > Users. Using a user identity prevents DTS from accessing the database instance and causes an error.

-
On the Roles page, click Create Role.

-
In the Create Role panel, complete the following settings:
-
Set Principal Type to Cloud Account.

-
Set Principal Name to Other Account, then enter the account ID of Account A (the account that owns the source instances).

-
Click OK.
-
Enter a role name and click OK. In this example, the role name is ram-for-dts.

-
-
On the Permissions tab, click Precise Permission.

-
In the Precise Permission panel, complete the following settings:
-
Set Policy Type to System Policy.

-
Enter AliyunDTSRolePolicy in the Policy Name field. > Note: AliyunDTSRolePolicy is the default system policy that grants DTS the permissions required to perform data migration and synchronization tasks.
-
Click OK.
-
-
Click the refresh icon on the Permissions tab to verify that the permission was granted.

Step 2: Authorize the RAM role to access the VPC
All steps in this section are also performed in Account A.
-
Log in to the RAM console using Account A.
-
In the left-side navigation pane, choose Identities > Roles.

-
Find the RAM role created in Step 1 and click the role name.
-
On the Permissions tab, click Grant Permission.
-
In the Grant Permission panel, complete the following settings:
-
Set Resource Scope to Account. For more information, see Grant permissions to a RAM role.
-
In the Policy section, select System Policy from the drop-down list.
-
Search for AliyunVPCReadOnlyAccess and select it. > Note: AliyunVPCReadOnlyAccess allows DTS to read VPC and subnet metadata to locate your Express Connect, VPN Gateway, or Smart Access Gateway connection.
-
Click Grant permissions, then click Close.
-
-
Modify the trust policy of the RAM role:
-
Click the Trust Policy tab.

-
Click Edit Trust Policy.
-
Replace the existing policy with the following: ``
json { "Statement": [ { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": { "RAM": [ "acs:ram::<Alibaba Cloud account ID>:root" ], "Service": [ "<Alibaba Cloud account ID>@dts.aliyuncs.com" ] } } ], "Version": "1" }`` -
Replace both instances of
<Alibaba Cloud account ID>with the account ID of Account B (the destination database owner). -
Click OK.
If
<Alibaba Cloud account ID>@dts.aliyuncs.comin theServicefield is automatically changed todts.aliyuncs.comafter you save, the account ID is invalid. Verify the account ID and try again. -
Configure a DTS task
The following steps show how to configure a synchronization task using Account B (the destination instance owner).
-
Log in to the DTS console or DMS console using Account B.
DTS console
-
Log in to the DTS console.
-
In the left-side navigation pane, click Data Synchronization.
-
In the upper-left corner, select the region where the data synchronization instance resides.
DMS console
NoteThe actual steps may vary based on your DMS console mode and layout. For more information, see Simple mode and Customize the layout and style of the DMS console.
-
Log in to the DMS console.
-
In the top navigation bar, move the pointer over Data + AI and choose DTS (DTS) > Data Synchronization.
-
From the drop-down list next to Data Synchronization Tasks, select the region where the data synchronization instance resides.
-
-
Click Create Task to go to the task configuration page.
-
On the Configurations for Source and Destination Databases page, configure the source database. The following table describes the parameters:
Parameter Description Select Existing Connection This parameter is not set in this example. Database Type Select based on your database type. Access Method Select Express Connect, VPN Gateway, or Smart Access Gateway. Instance Region Select the region where the source database resides. Replicate Data Across Alibaba Cloud Accounts Select Yes. Alibaba Cloud Account Enter the account ID of Account A (the VPC owner). RAM Role Name Enter the name of the RAM role created in Step 1. In this example, enter ram-for-dts. Connected VPC Select the VPC that contains your Express Connect, VPN Gateway, or Smart Access Gateway connection. If an error occurs, see the Common errors section in "Configure a DTS task across Alibaba Cloud accounts". -
Configure the remaining parameters based on your requirements and the related topics.