All Products
Search
Document Center

DataWorks:CreateImportMigration

Last Updated:Aug 28, 2026

Creates an import task that contains data sources, nodes, and tables.

Operation description

Upload the import package as shown:

    Config config = new Config();
    config.setAccessKeyId(accessId);
    config.setAccessKeySecret(accessKey);
    config.setEndpoint(popEndpoint);
    config.setRegionId(regionId);
    
    Client client = new Client(config);

    CreateImportMigrationAdvanceRequest request = new CreateImportMigrationAdvanceRequest();
    request.setName("test_migration_api_" + System.currentTimeMillis());
    request.setProjectId(123456L); 
    request.setPackageType("DATAWORKS_MODEL");
    request.setPackageFileObject(new FileInputStream("/home/admin/Downloads/test.zip"));

    RuntimeOptions runtime = new RuntimeOptions();
    CreateImportMigrationResponse response = client.createImportMigrationAdvance(request, runtime);
    ...

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

dataworks:*

update

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

ProjectId

integer

Yes

The DataWorks workspace ID. You can obtain it from the Workspace page in the DataWorks console.

123456

Name

string

Yes

The import task name. Must be unique within the workspace.

test_import_001

PackageType

string

Yes

The type of the import package. Valid values:

  • DATAWORKS_MODEL (standard format)

  • DATAWORKS_V2 (Apsara Stack DataWorks V3.6.1 to V3.11)

  • DATAWORKS_V3 (Apsara Stack DataWorks V3.12 and later)

DATAWORKS_MODEL

PackageFile

string

Yes

The import package file path. Upload the package as shown:

        Config config = new Config();
        config.setAccessKeyId(accessId);
        config.setAccessKeySecret(accessKey);
        config.setEndpoint(popEndpoint);
        config.setRegionId(regionId);

        Client client = new Client(config);

        CreateImportMigrationAdvanceRequest request = new CreateImportMigrationAdvanceRequest();
        request.setName("test_migration_api_" + System.currentTimeMillis());
        request.setProjectId(123456L); 
        request.setPackageType("DATAWORKS_MODEL");
        request.setPackageFileObject(new FileInputStream("/home/admin/Downloads/test.zip"));

        RuntimeOptions runtime = new RuntimeOptions();
        CreateImportMigrationResponse response = client.createImportMigrationAdvance(request, runtime);

/home/admin/xxx/import.zip

ResourceGroupMap

string

No

The resource group mapping between scheduling and Data Integration. Keys and values are resource group identifiers. Format:

{
    "SCHEDULER_RESOURCE_GROUP": {
        "xxx": "yyy"
    },
    "DI_RESOURCE_GROUP": {
        "ccc": "dfdd"
    }
}

{"SCHEDULER_RESOURCE_GROUP": {"xxx":"yyy"},"DI_RESOURCE_GROUP":{"ccc":"ddd"}}

WorkspaceMap

string

No

The workspace name prefix mapping. During import, source workspace name prefixes are replaced with the mapped destination prefixes.

{"test_workspace_src": "test_workspace_target"}

CalculateEngineMap

string

No

The compute engine instance mapping from source to destination. Supported engines: MaxCompute, E-MapReduce (EMR), Hadoop CDH, and Hologres.

{ "ODPS": { "zxy_8221431_engine": "wzp_kaifazheban_engine" }, "EMR": { "aaaa": "bbb" } }

CommitRule

string

No

The auto-commit and auto-deploy rule for the import task. Parameters:

  • resourceAutoCommit: whether to auto-commit resources.

  • resourceAutoDeploy: whether to auto-deploy resources.

  • functionAutoCommit: whether to auto-commit functions.

  • functionAutoDeploy: whether to auto-deploy functions.

  • tableAutoCommitToDev: whether to auto-commit tables to the development environment.

  • tableAutoCommitToProd: whether to auto-commit tables to the production environment.

  • ignoreLock: whether to ignore locks on the import task. If true, the task is forcefully updated even when locked.

  • fileAutoCommit: whether to auto-commit files.

  • fileAutoDeploy: whether to auto-deploy files.

{ "resourceAutoCommit": false, "resourceAutoDeploy": false, "functionAutoCommit": false, "functionAutoDeploy": false, "tableAutoCommitToDev": false, "tableAutoCommitToProd": false, "ignoreLock": false, "fileAutoCommit": false, "fileAutoDeploy": false }

Description

string

No

The description of the import package.

test description

Response elements

Element

Type

Description

Example

object

The returned data.

HttpStatusCode

integer

The HTTP status code.

200

Data

integer

The import task ID. Use this ID to run the import task or query its progress.

123456

ErrorMessage

string

The error message.

test error message

RequestId

string

The request ID for troubleshooting.

ADFASDFASDFA-ADFASDF-ASDFADSDF-AFFADS

ErrorCode

string

The error code.

110001123456

Success

boolean

Whether the request was successful.

true

Examples

Success response

JSON format

{
  "HttpStatusCode": 200,
  "Data": 123456,
  "ErrorMessage": "test error message",
  "RequestId": "ADFASDFASDFA-ADFASDF-ASDFADSDF-AFFADS",
  "ErrorCode": "110001123456",
  "Success": true
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.