Compliance statement for cross-border data transmission
If you use XCOPY for cross-border data transmission, you must comply with all applicable laws and regulations in the relevant regions.
Note that this feature transfers your business data to your selected region or the region where the product is deployed, which may involve cross-border data transmission. You agree and confirm that you have full authority over this business data and are solely responsible for its transmission.
You must ensure that your data transmission complies with all applicable laws. This includes implementing adequate data security technologies and policies, fulfilling legal obligations such as obtaining sufficient explicit consent from individuals and completing data export security assessments and filings. You also warrant that your business data does not contain any content that is restricted or prohibited from transmission or disclosure under applicable laws.
If you fail to comply with the preceding statements and warranties, you will bear the corresponding legal consequences. You are liable for any losses incurred by Alibaba Cloud or its affiliates as a result of your non-compliance.
Features
The cross-region replication (XCOPY) feature supports incremental replication of table snapshots. It is ideal for scenarios such as cross-region data backup, migration, and sharing.
It uses file-level incremental replication to copy column-compressed binary data files, which provides a balance of transfer efficiency, cost reduction, and data consistency.
Replication is based on table snapshots. The replicated data is decoupled from the source table, allowing you to manage the backup lifecycle independently.
Table snapshot replicas provide a well-defined point for Point-in-Time Recovery (PITR), which enables you to restore recently lost data from the upstream data source.
Incremental replication is performed at the partition level. When replicating between two snapshots of the same table, only differential partitions are copied. Duplicate partitions are automatically skipped to avoid redundant replication.
Billing: For more information, see Cross-region data replication fees.
Scope and limits
Supported regions: China (Hong Kong), Singapore, and Japan (Tokyo).
Cross-region bandwidth: The initial bandwidth is 10 Gbps and can be adjusted as needed.
Target object: table snapshot.
Table snapshots are supported for standard tables (including partitioned, non-partitioned, and clustered tables) and PK/Append Delta tables. They are not supported for transactional tables.
XCOPY task limit:
A maximum of 128 XCOPY snapshot tasks can run concurrently within a single project. Subsequent task submissions will fail if this limit is exceeded.
Permission requirements:
The source project and the destination project must belong to the same primary account.
You must have
SELECTpermission on the source table snapshot in the source project.You must have
CREATE TABLEpermission in the destination project.
We recommend using the backup project in the backup region only for storing backup data and running temporary queries. If you need to run production workloads in the backup region, create a separate project.
Enable XCOPY
Procedure
Submit a ticket with the name of the project you want to back up.
Enable the XCOPY channel switch in the console.
In the source region, enable the XCOPY Channel Switch to allow authorized users to copy data to other regions by using XCOPY.
Log on to the MaxCompute console, and select a region in the upper-left corner.
In the navigation pane on the left, choose .
On the Tenants page, click the Tenant Property tab.
On the Tenant Property tab, enable the XCOPY Channel Switch.
XCOPY command reference
Syntax
XCOPY SNAPSHOT <src_remote_project_name>.<src_remote_snapshot_name>
TO SNAPSHOT [<dest_local_project_name>.]<dest_local_snapshot_name>
OPTIONS(src_region=<region_name>); Parameters
src_remote_project_name: Specifies the name of the source project.
src_remote_snapshot_name: Specifies the name of the table snapshot in the source project.
dest_local_project_name: Specifies the name of the destination project. This parameter is optional.
dest_local_snapshot_name: Specifies the name of the table snapshot to create or overwrite in the destination project.
region_name: Specifies the name of the source region. Examples:
cn-hongkongfor China (Hong Kong) andap-northeast-1for Japan (Tokyo). For more information, see Region name.
Examples
This example shows a disaster recovery backup from a primary region in Singapore (SGP) to a backup region in China (Hong Kong) (HK), as shown in the following figure:

Backup phase
Primary region (Singapore): In
Project_AunderAccount A (User1), you create snapshotsSNAPSHOT_X1/X2andSNAPSHOT_Y1for the source tablesTable_XandTable_Y, respectively.-- Backup phase -- A user creates a snapshot in the Singapore region (Region-SGP). CREATE SNAPSHOT TABLE Project_A.table_x_snapshot_20260101 CLONE Project_A.table_x;Cross-region replication phase
XCOPY replicates the snapshot data from the primary region to the backup region over a dedicated cross-region, cross-border connection.
-- A user copies the snapshot created in Region-SGP to the China (Hong Kong) region (Region-HK). XCOPY SNAPSHOT Project_A.table_x_snapshot_20260101 TO SNAPSHOT Project_B.table_x_snapshot_20260101 OPTIONS( src_region =” ap-southeast-1”);Recovery phase
Backup region (China (Hong Kong)):
Project_Breceives the replicated snapshot. You can then restore the snapshot to a target table, such asTable_Z.-- Recovery phase -- A user runs temporary queries on the backup data in Region-HK. SELECT * FROM Project_B.table_x_snapshot_20260101; -- A user restores data in Region-HK. CREATE TABLE table_x CLONE table_x_snapshot_20260101;
Daily cross-region table backup
Step 1: Create snapshot in primary region
Go to the DataWorks development environment
Log on to the DataWorks console and select a region in the upper-left corner.
In the left navigation pane, click Workspace.
Select Workspace and click Go to Data Studio.
Create a MaxCompute SQL node
In the left-side pane of the Data Studio page, click the
icon and choose .Node Name: create_daily_snapshots
Node Description: Create daily snapshots for tables.
Write the SQL script
-- This script creates daily snapshots for tables 'a' and 'b'. The variables ${var1} and ${var2} are placeholders for the current date, which are configured in the DataWorks scheduling properties. CREATE SNAPSHOT TABLE a_snapshot_${var1} CLONE a; CREATE SNAPSHOT TABLE b_snapshot_${var2} CLONE b;Configure scheduling properties
In the upper-right corner of the node editor, click Scheduling Configuration. In the panel that appears, click Scheduling Time and configure the properties as follows:
Parameter
Example value
Scheduling Cycle
Daily
Scheduling Time
01:00
Effective Date
Permanent
Specified Time: 2026-01-01 to 9999-12-31 (long-term)
Step 2: XCOPY snapshot to backup region
Go to the DataWorks development environment
Log on to the DataWorks console and select a region in the upper-left corner.
In the left navigation pane, click Workspace.
Select Workspace and click Go to Data Studio.
Create a MaxCompute SQL node
In the left-side pane of the Data Studio page, click the
icon and choose .Node Name: create_daily_snapshots
Node Description: Create daily snapshots for tables.
Write the SQL script
-- This script uses XCOPY to replicate the daily snapshots created in the source region. XCOPY SNAPSHOT src_project.a_snapshot_$[yyyymmdd] TO SNAPSHOT a_snapshot_$[yyyymmdd] options(src_region="cn-hongkong"); XCOPY SNAPSHOT src_project.b_snapshot_$[yyyymmdd] TO SNAPSHOT b_snapshot_$[yyyymmdd] options(src_region="cn-hongkong");Configure scheduling properties
In the upper-right corner of the node editor, click Scheduling Configuration. In the panel that appears, click Scheduling Time and configure the properties as follows:
Parameter
Example value
Scheduling Cycle
Daily
Scheduling Time
02:00
Effective Date
Permanent
Specified Time: 2026-01-01 to 9999-12-31 (long-term)
Step 3: Verify snapshot integrity
Check the tenant-level Information Schema to verify that all snapshots were successfully replicated to the backup region.
In the backup region, run the following code to count the snapshots replicated to the backup region for a specific day.
SET odps.namespace.schema=true; SELECT * FROM SYSTEM_CATALOG.INFORMATION_SCHEMA.tables WHERE table_catalog = <dest_project> AND table_type = 'SNAPSHOT_TABLE' AND table_name LIKE "%_snapshot_20260101";Perform sample data validation (optional)
Calculate statistics and MD5 checksums for the snapshots in both the primary and backup region to verify data consistency.
-- Compare statistics by using count, sum, distinct, min, and max. -- To perform a detailed comparison, divide the table into 1,000 buckets. Ensure that the sum of MD5 hashes for all rows within each bucket is identical. -- The MD5 hash for each row is calculated by concatenating the values of all its columns into a single string. WITH table_hashs AS ( SELECT COUNT(1) row_count, MD5( SUM( MD5( CONCAT_WS('|', <column_name_1>, <column_name_n>) ) ) ) AS bucket_hash FROM <snapshot_name> GROUP BY HASH(<column_name_1>) % 1000 ) SELECT SUM(row_count) AS row_count, MD5(WM_CONCAT(',', bucket_hash ) WITHIN GROUP (ORDER BY bucket_hash)) AS table_hash FROM table_hashs;