You need to enable JavaScript to run this app.
Data Migration Service

Data Migration Service

Copy page
Download PDF
Task Management
CreateDataMigrateTask - Create migration task
Copy page
Download PDF
CreateDataMigrateTask - Create migration task
Call the CreateDataMigrateTask API to create a migration task.​
Request parameters​
Only the unique request parameters and some common parameters for this API are listed below. For more information, see Public parameters.​
Action string required Example: CreateDataMigrateTask​
Operation to perform: CreateDataMigrateTask.​
​
Version string required Example value: 2018-01-01​
API version: 2018-01-01.​
​
BasicConfig object required</a> Example: -​
Basic migration task configuration.​
TaskName string required Example: dms​
Name of the migration task.​
​
FailedNumToAbortintegerOptional Example: 2​
The number of objects allowed to continuously fail migration tasks. Valid values: [-1, +∞). -1 indicates no limit; the default value is 20.​
​
EnableRangeCheck boolean Optional Example value: true​
Enable sampling verification to have DMS retrieve 100 bytes from each object on both the source and target ends, then check for consistency between them. The options are as follows:​
  • true: Enable sampling verification.​
  • false: Disable sampling verification.​
  • The default value is false.​
​
OverwritePolicy string required Example: Force​
Migration task overwrite policy; value descriptions are as follows:​
  • Force: For files with the same name, overwrite the target directly with the source without any validation.​
  • None: For files with the same name, skip directly without any validation.​
  • LastModify: When files with the same name exist at the source and target, use the lastmodify field (last modified time) to determine whether to overwrite. Overwrite only if the source file's last modified time is later than the target file's last modified time.​
​
SourceType string required Example: StorageTypeObject​
Source data types are described as follows:​
  • StorageTypeObject: The source data type is object storage.​
  • StorageTypeUrl: The source data type is a URL list.​
​
StorageClass string required Example: Standard​
The storage type for migrated objects on the target, as described below:​
  • Standard: Standard Storage​
  • InheritSource: Inherit source storage type​
  • Ia: Infrequent Access Storage​
  • ArchiveFr: Flashback Archive Storage​
  • IntelligentTiering: Intelligent Tiering Storage​
  • ColdArchive: Cold Archive Storage​
  • Archive: Archive Storage​
  • DeepColdArchive: Deep Cold Archive​
​
ObjectMigrationPolicy object Optional​
Migration policy​
SyncAcl boolean Optional​
Migrate object ACL​
​
SyncTag boolean Optional​
Whether to migrate object tags​
​
SyncSymlink boolean Optional​
Whether to migrate the Symlink object​
​
​
OfflineMigrationPolicy object Optional​
Offline migration configuration​
Source stringrequired​
Source bucket type​
​
Target stringrequired​
Target bucket type​
​
​
Bandwidth long Optional Example value: 200000​
The default bandwidth of the migration task, in bytes per second. The default value is 1073741824.​
​
​
AdvanceConfig object Optional Example: -​
Advanced configuration for migration tasks.​
PrivateLink object Optional Example: -​
Network configuration for data migration using a dedicated connection.​
VpcID string required Example: vpc-3ewj81jek8l4w70o42vd****​
Private network ID.​
​
SubnetID string required Example value: subnet-36stxciqoo6ww383g0x25****​
Subnet ID in the private network.​
​
SecurityGroupIDs string[] required Example: sg-3rfeg3y7jccg016nf3p9v****​
Security group ID in private network.​
​
IdcIP string required Example: 192.168.0.0​
IPv4 address of the data center.​
​
IdcPort integer required Example: 8008​
Port number for the IPv4 address of the data center.​
​
ENIRole string required Example value: DMSEniCtlRole​
Name of the delegated role for the user's virtual network card. DMS requires this role to obtain necessary permissions when creating a shuttle.​
tip​
After you create a DMS dedicated line task in the console, the DMSEniCtlRole role is automatically created. It is recommended to create the dedicated line task in the console first; otherwise, you need to manually create this role.​
​
​
RenameSetting object Optional Example: -​
Object renaming configuration.​
Pattern string required Example: ^​
Regular expression rule for renaming.​
​
ReplaceStr string required Example: prefix-path/​
Target string to be replaced.​
​
​
IncreaseSetting object Optional Example value: -​
Incremental migration configuration.​
Times integer required Example value: 1​
After the initial migration is completed, set the number of incremental migrations. Only supports integers from 1 to 100.​
​
Interval integer required Example value: 3600​
Incremental migration interval, which is the time between each incremental migration task. The unit is seconds, and only integers in the range 3600 to 86400 are supported.​
​
​
TimeBandwidthSetting object[] Optional Example: -​
Configure time-based flow control.​
Start integer required Example value: 23​
The start time for traffic control, ranging from 0 to 23.​
​
End integer required Example value: 2​
Flow control end time. The value can range from 1 to 24.​
​
Bandwidth long required Example value: 100​
Flow control rate, unit: Byte/s.​
​
​
​
Source object required Example value: -​
Migration task source configuration.​
ObjectSourceConfig object Optional Example: -​
Access configuration for object storage as the source data source.​
BucketAccessConfig object required Example: -​
Access configuration for the bucket where the object is stored.​
AKstringOptional Example: AKLTM2NlN2E5Yzg2ZDhkNDBjMGIzZGU3MDllMzE4NzU****​
AccessKey ID for accessing object storage.​
​
SK string optional Example value: T1RkbVpHTmlNakl3TWpobE5EVmlObUkzTURrMU16STNZakF4TW****​
AccessKey Secret for accessing object storage.​
​
BucketName string required Example: test​
Bucket name.​
​
RoleTrn string Optional Example: trn:iam::210015****:role/dms_role​
RoleTrn used for cross-service authorization.​
tip​
After setting RoleTrn, you do not need to set AK or SK information. With your authorization, DMS can directly access the bucket list and files.​
​
VendorstringrequiredExample value: StorageVendorTOS​
Source data source. Details are as follows:​
  • StorageVendorTOS: Object Storage - Volcano Engine​
  • StorageVendorS3: Other S3 protocol storage​
  • StorageVendorOBS: Huawei Cloud​
  • StorageVendorCOS: Tencent Cloud​
  • StorageVendorOSS: Alibaba Cloud​
  • StorageVendorKodo: Qiniu Cloud​
  • StorageVendorKs3: Kingsoft Cloud​
  • StorageVendorGCS: Google Cloud​
  • StorageVendorURLAtEndPoint: When the source data is a list of URLs, select this option to use the download address to retrieve the file list.​
tip​
When creating a migration task using the CreateDataMigrateTask API, only one URL list file upload method is supported—the download address.​
​
Region string required Example value: cn-beijing​
Region where the bucket is located.​
​
Endpoint string required Example value: tos-cn-beijing.volces.com​
The access domain for object storage, excluding the bucket name.​
​
​
PrefixList string[] Optional Example value: [prefix1,prefix2]​
List of prefixes to migrate. Separate multiple prefixes with commas.​
tip​
PrefixList, PrefixListFile, and KeyListFile specify the files to migrate. You only need to set one of these parameters.​
​
PrefixListFile string Optional Example: https://test.tos-cn-beijing.volces.com/excel.txt​
Specify the access link for the prefix list file to be migrated.​
​
KeyListFile string Optional Example: https://test.tos-cn-beijing.volces.com/data.txt​
Access link to the list of objects to be migrated.​
​
ScanWithDelimiter boolean Optional Example: true​
Indicates whether the source uses delimiters when listing objects. The options are as follows:​
  • true: Enables delimiter listing. DMS can retrieve files from multi-level directories in the source bucket, ensuring complete file migration to TOS.​
warning​
If you use delimiter listing, set the migration range to include (set IsExcluded to false) and specify the migration range with a prefix (by setting the PrefixList parameter or the PrefixListFile parameter), the prefix must end with a forward slash (/).​
  • false: Does not use delimiter listing. Migration will be faster, but in scenarios such as bucket acceleration on the source, migrating to TOS may result in incomplete files.​
​
StartTime string Optional Example value: "2024-09-03 14:26:57"​
Specify the migration files by date. Only files created or modified after the specified date will be migrated.​
​
IsExcluded boolean required Example value: true​
Specifies objects to exclude from migration. Must be used with PrefixList or PrefixListFile; otherwise, it is invalid.​
After specifying objects using PrefixList or PrefixListFile, different values for IsExcluded result in different migration operations. The options are as follows:​
  • true: Excludes specified objects. When enabled, DMS will exclude the objects listed in PrefixList or PrefixListFile and only migrate the remaining objects.​
  • false: Does not exclude objects. DMS will migrate the objects specified in PrefixList or PrefixListFile.​
​
​
UrlSourceConfig object Optional Example value: -​
Access configuration for URL list data sources at the source side.​
IsUrlTryRangeGet boolean Optional Example: false​
Enable range-get migration as described below:​
  • true: Enable range-get migration. When enabled, DMS supports breakpoint resume for file migration. If file transmission is interrupted due to network fluctuations, DMS restarts transmission from the breakpoint, avoiding extra traffic from retransmitting files from the beginning and reducing costs.​
  • false: Do not enable range-get migration.​
​
BucketAccessConfig object Optional Example: -​
Configuration for accessing the bucket containing the URL list file.​
tip​
BucketAccessConfig and UrlListName are used to specify the bucket and list file name for selecting the URL file list, so both BucketAccessConfig and UrlListName must be set.​
AK string Optional Example value: AKLTM2NlN2E5Yzg2ZDhkNDBjMGIzZGU3MDllMzE4NzU****​
AccessKey ID for object storage access.​
​
SKstringOptional Example: T1RkbVpHTmlNakl3TWpobE5EVmlObUkzTURrMU16STNZakF4TW****​
AccessKey Secret for accessing object storage.​
​
BucketName string required Example value: test​
Bucket name.​
​
RoleTrn string Optional Example: trn:iam::210015****:role/dms_role​
RoleTrn for cross-service authorization.​
tip​
After setting RoleTrn, you do not need to set AK or SK information. Once authorized, DMS can directly access bucket lists and files.​
​
Vendor string requiredExample: StorageVendorTOS​
Source data source options:​
  • StorageVendorTOS: Object Storage - Volcano Engine​
  • StorageVendorS3: Other S3 protocol storage​
  • StorageVendorOBS: Huawei Cloud​
  • StorageVendorCOS: Tencent Cloud​
  • StorageVendorOSS: Alibaba Cloud​
  • StorageVendorKodo: Qiniu Cloud​
  • StorageVendorKs3: Kingsoft Cloud​
  • StorageVendorGCS: Google Cloud​
  • StorageVendorURLAtEndPoint: When the source data is a URL list, select this option to use download links for retrieving the file list.​
tip​
When creating a migration task with the CreateDataMigrateTask API, only one URL list upload method is supported: via download links.​
​
Region string required Example value: cn-beijing​
The region where the bucket is located.​
​
Endpointstringrequired Example: tos-cn-beijing.volces.com​
Access domain name for object storage, excluding the bucket name.​
​
​
UrlListName string Optional Example value: data.txt​
Name of the URL list.​
tip​
Either UrlListLink or UrlListName can be set; do not configure both parameters.​
​
UrlListLink string Optional Example value: https://test.tos-cn-beijing.volces.com/data.txt​
Public access link for the URL list.​
tip​
Choose either UrlListLink or UrlListName; you do not need to set both.​
​
​
​
Target object required Example value: -​
Migration task target configuration.​
AK string Optional Example: AKLTM2NlN2E5Yzg2ZDhkNDBjMGIzZGU3MDllMzE4NzU****​
AccessKey ID used to access the target object storage.​
​
SK string Optional Example: T1RkbVpHTmlNakl3TWpobE5EVmlObUkzTURrMU16STNZakF4TW****​
AccessKey Secret used to access the target object storage​
​
BucketName string required Example: data​
Target bucket name.​
​
RoleTrn string Optional Example value: trn:iam::2100xxxx4:role/dms_role​
RoleTrn used for cross-service authorization.​
tip​
After setting RoleTrn, you do not need to configure AK or SK information. With your authorization, DMS can directly read bucket lists and files.​
​
​
​
​
Return parameters​
Only the unique return parameters for this API are listed below. For more details, see Return structure.​
Task ID long Example: 298686​
Task ID.​
​
​
​
Sample request​
​
POST /?Action=CreateDataMigrateTask&Version=2018-01-01 HTTP/1.1​
Host: dms.cn-beijing.volcengineapi.com​
Content-Type: application/json; charset=UTF-8​
X-Date: 20240513T062624Z​
X-Content-Sha256: 287e874e******d653b44d21e​
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20240513/cn-beijing/dms/request, SignedHeaders=host;x-content-sha256;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f​
​
{​
"BasicConfig":​
{​
"OverwritePolicy": "Force",​
"SourceType": "StorageTypeObject",​
"StorageClass": "Standard",​
"TaskName": "test1"​
},​
"Source":​
{​
"ObjectSourceConfig":​
{​
"BucketAccessConfig":​
{​
"AK": "AKLTM2NlN2E5Yzg2ZDhkNDBjMGIzZGU3MDllMzE4NzU****",​
"BucketName": "data",​
"Endpoint": "http://tos-cn-beijing.volces.com",​
"Region": "cn-beijing",​
"SK": "T1RkbVpHTmlNakl3TWpobE5EVmlObUkzTURrMU16STNZakF4TWpNME0y****",​
"Vendor": "StorageVendorTOS"​
}​
}​
},​
"Target":​
{​
"AK": "AKLTM2NlN2E5Yzg2ZDhkNDBjMGIzZGU3MDllMzE4NzU****",​
"BucketName": "bucketname",​
"SK": "T1RkbVpHTmlNakl3TWpobE5EVmlObUkzTURrMU16STNZakF4TWpNME0y****"​
}​
}​
​
Sample response​
​
{​
"ResponseMetadata": {​
"RequestId": "2024051314263307210712807736****",​
"Action": "CreateDataMigrateTask",​
"Version": "2018-01-01",​
"Service": "dms",​
"Region": "cn-beijing"​
},​
"Result": {​
"TaskID": 298686​
}​
}​
​
Error code​
The table below lists error codes related to API business logic. For public error codes, refer to the Public error codes documentation.​
​
Status Code​
Error codes​
Error message​
Description​
400​
InvalidParameter​
Invalid Parameter.​
Invalid parameter.​
400​
InvalidTaskName​
Task name must contain 3-32 letters, numbers, and dash (-), and cannot start or end with dash (-).​
Invalid task name.​
400​
InvalidParameterAssumeRole​
Assume role check failed, illegal trn.​
Invalid Roletrn.​
400​
InvalidParameterTooManyPrefix​
Up to prefixes num.​
The number of prefixes exceeds the limit.​
405​
InvalidStorageType​
Not support this source type.​
This source type is not supported.​
408​
CreateDataMigrateTaskTimeout​
Wait creating task timeout.​
Task creation timed out.​
409​
TaskNameExists​
Task name already exists, please select another task name.​
Duplicate task name.​
429​
TaskLimitExceed​
The number of tasks exceeds the upper limit.​
The number of tasks exceeds the limit.​
500​
InnerDBAccessErr​
Access DB failed.​
Internal error.​
​
​
Last updated: 2026.02.02 11:05:22