All Products
Search
Document Center

:Migrate from OSS to a local file system

Last Updated:Oct 13, 2026

Review the considerations and limitations, then follow the procedure to migrate data from Alibaba Cloud OSS to a local file system.

Considerations

Keep the following in mind when migrating data:

  • The Directory To Be Migrated must be an absolute path that starts and ends with a forward slash (/). The path cannot contain environment variables or special characters.

  • Ensure the Directory To Be Migrated exists and is valid.

  • The migration service uses the standard public APIs of the source storage provider to access source data. The service's behavior depends on the provider's specific API implementation.

  • Migration consumes resources at both the source and destination. To avoid impacting business-critical workloads, configure bandwidth throttling or run the task during off-peak hours.

  • The service inspects files at both addresses before migration. If overwrite mode is enabled, destination files with matching names are overwritten. To prevent data loss when file contents differ, rename or back up destination files before starting the migration.

Warning

After migration completes, you must verify the data integrity at the destination. You are solely responsible for any data loss caused by deleting source data before completing verification.

Migration limitations

  • If static website hosting is enabled for the source bucket, the migration scan may detect nonexistent directories. For example, uploading myapp/resource/1.jpg causes the scan to detect myapp/, myapp/resource/, and myapp/resource/1.jpg. Migration of myapp/ and myapp/resource/ fails, but myapp/resource/1.jpg migrates successfully.

  • If a source object name ends with a forward slash (/), its attributes are applied to the corresponding directory on the destination file system. The task overwrite mode is ignored for such objects.

  • If the source bucket contains objects whose names end with a forward slash (/), they are treated as directories on the destination. For example, if the source contains the objects a/, a/b/, and a/b/c/, this creates the nested directory path a/b/c/ after migration.

  • You can migrate data from only one bucket per migration task. To migrate data from an entire account, you must create a separate task for each bucket.

  • Migration from Alibaba Finance Cloud or Alibaba Gov Cloud is not supported.

  • Migrating data from Alibaba Cloud OSS to a local file system does not preserve all object attributes:

    • Supported: LastModifyTime is migrated and set as ModifyTime on the local file system.

    • Unsupported (not exhaustive): x-oss-meta-*, Content-Type, Cache-Control, Content-Encoding, Content-Disposition, Content-Language, Expires, StorageClass, Acl, server-side encryption, tagging, and user-defined headers such as x-oss-persistent-header.

      Note

      The behavior of unlisted attributes is not guaranteed. Always verify your data at the destination after migration.

Step 1: Select a region

  1. Log in to the Data Online Migration console with the RAM user.

  2. In the top-left corner of the top navigation bar, select the agent's region.

    Important
    • Tunnels, agents, data addresses, and migration tasks are region-specific. Choose your region carefully.

    • Select the agent's region. If unavailable, select the nearest region.

Step 2: Create a tunnel

  1. In the left-side navigation pane, choose Data Online Migration > Channel Management, and then click Create Tunnel.

  2. In the Create Tunnel dialog box, configure the following parameters and click OK.

    Parameter

    Required

    Description

    Name

    Yes

    The name of the tunnel.

    • The name cannot be empty and can be up to 100 characters in length.

    • The name can contain letters, digits, hyphens (-), and underscores (_).

    Maximum Bandwidth

    Yes

    The maximum bandwidth that the tunnel can use.

    • If you do not configure this parameter, the default value 0 is used, which indicates that the bandwidth for the tunnel is not limited.

    • If you configure this parameter, enter a value based on the note in the console.

    Important

    The bandwidth that is available for the tunnel depends on the actual bandwidth of the network connection.

    Requests/s

    Yes

    The maximum number of requests per second over the tunnel.

    • If you do not configure this parameter, the default value 0 is used, which indicates that the number of requests per second over the tunnel is not limited.

    • If you configure this parameter, enter a value based on the note in the console.

    Warning

    We recommend that you evaluate the capabilities of the storage system of the data source before you configure this parameter. If you set this parameter to a great value, your business is affected. We recommend that you enter a value based on the note in the console.

Note

Manage tunnels in Tunnel Management.

Step 3: Create an agent

  1. In the left-side navigation pane, choose Data Online Migration > Agent Management, and then click New Agent.

  2. In the New Agent dialog box, configure the following parameters, and then click OK.

    Parameter

    Required

    Description

    Name

    Yes

    The agent's name.

    • The name must be 3 to 63 characters long.

      • The name can contain lowercase letters, digits, hyphens (-), and underscores (_). The name is case-sensitive.

      • The name must be UTF-8 encoded and cannot start with a hyphen (-) or an underscore (_).

    Network Type

    Yes

    The network connection type for the agent. The following options are available:

    • VPC (Recommended): The agent connects to the Data Online Migration service over a VPC. This method requires the machine that hosts the agent to access the internal endpoint of Data Online Migration in the corresponding region. For example, if you use Data Online Migration in the China (Beijing) region, the agent machine must be able to access the internal endpoint {TunnelId}.cn-beijing.mgw-tc-internal.aliyuncs.com. We recommend using an ECS instance in the same region as the Data Online Migration console to deploy the agent.

    • Public network: The agent connects to the Data Online Migration service over the public network. This method requires the machine that hosts the agent to access the public endpoint of Data Online Migration in the corresponding region. For example, if you use Data Online Migration in the China (Beijing) region, the agent machine must be able to access the public endpoint {TunnelId}.cn-beijing.mgw-tc.aliyuncs.com.

    Note
    • {TunnelId} is a placeholder for the tunnel ID.

    • You can use the ping command to test the network connectivity between the agent and the Data Online Migration service.

    Deployment method

    Yes

    The agent's deployment method. Currently, only standalone process deployment is supported.

    Tunnel

    Yes

    The tunnel to associate with the agent. An agent can be associated with only one tunnel. The bandwidth of the agent is limited by the total bandwidth of the tunnel.

    For example, a tunnel named tunnel-1 is configured with a maximum bandwidth of 10 Gbit/s. tunnel-1 is associated with three agents: agent-1, agent-2, and agent-3. The combined bandwidth of these three agents cannot exceed 10 Gbit/s. If agent-1 is allocated 3 Gbit/s of bandwidth, only 7 Gbit/s of bandwidth remains available for agent-2 and agent-3. Plan and allocate your bandwidth carefully.

  3. Generate the agent deployment script. For instructions, see Generate agent deployment script.

Note

Manage agents in Agent Management.

Step 4: Create a source address

  1. In the left-side navigation pane, choose Data Online Migration > Address Management, and then click Create Address.

  2. In the Create Address panel, configure the following parameters and click OK.

    Parameter

    Required

    Description

    Name

    Yes

    • The name must be 3 to 63 characters in length.

    • The name can contain lowercase letters, digits, hyphens (-), and underscores (_). The name is case-sensitive.

    • The name cannot start with a hyphen (-) or an underscore (_).

    Type

    Yes

    Select OSS.

    Region

    Yes

    Select the region of the source bucket, for example, China (Hangzhou).

    RAM role

    Yes

    Bucket

    Yes

    Enter the source bucket name.

    Agent

    No

    Select the name of the agent to use.

    Important
    • This parameter is required only when migrating data over an Express Connect or VPN connection, or when migrating data from a self-managed storage system.

    • You can select a maximum of 200 agents for a specified channel.

Step 5: Create a destination address

  1. In the left-side navigation pane, choose Data Online Migration > Address Management, and then click Create Address.

  2. In the Create Address panel, configure the following parameters and click OK.

    Parameter

    Required

    Description

    Name

    Yes

    Enter a name for the destination address. The name must meet the following requirements:

    • The name must be 3 to 63 characters in length.

    • The name can contain lowercase letters, digits, hyphens (-), and underscores (_). The name is case-sensitive.

    • The name cannot start with a hyphen (-) or an underscore (_).

    Type

    Yes

    Select LocalFS.

    Directory To Be Migrated

    Yes

    Path prefix for the destination directory. Source data is migrated to this location.

    The path must be an absolute path that starts and ends with a forward slash (/). Environment variables and special characters are not supported.

    For example, consider a source data address with the prefix /example/src/ that contains the file example.jpg. If you set this parameter to /example/dest/, the file is migrated to /example/dest/example.jpg.

    Important

    If a data address is associated with multiple agents, ensure each agent can access the directory. Otherwise, some data may fail to migrate.

    Tunnel

    Yes

    Select the name of the channel to use.

    Important
    • This parameter is required only when migrating data over an Express Connect or VPN connection, or when migrating data from a self-managed storage system.

    • You must associate an agent if the destination is a local file system or if the migration uses a dedicated connection, for example, to a financial cloud or Apsara Stack environment.

    Agent

    Yes

    Select the name of the agent to use.

    Important
    • This parameter is required only when migrating data over an Express Connect or VPN connection, or when migrating data from a self-managed storage system.

    • You can select a maximum of 200 agents for a specified channel.

Step 6: Create a migration task

  1. In the left-side navigation pane, choose Data Online Migration > Migration Tasks, and then click Create Task.

  2. On the Select Address page, configure the following parameters, and then click Next.

    Parameter

    Required

    Description

    Name

    Yes

    Enter a name for the migration task. The name must meet the following requirements:

    • The name must be 3 to 63 characters in length.

    • The name can contain lowercase letters, digits, hyphens (-), and underscores (_). The name is case-sensitive.

    • The name cannot start with a hyphen (-) or an underscore (_).

    Source Address

    Yes

    Select an existing source address.

    Destination Address

    Yes

    Select an existing destination address.

  3. On the Task Configurations page, configure the following parameters.

    Parameter

    Required

    Description

    Basic settings

    Migration Bandwidth

    No

    Select the migration bandwidth.

    • Default: The maximum available bandwidth. The actual speed depends on the file size and the number of files.

    • Specify an upper limit: Specify a maximum bandwidth limit.

    Important
    • The actual migration bandwidth depends on factors such as the data source, network conditions, destination throttling, and file size, and may not reach the specified upper limit.

    • Select a value based on your data source, destination, business requirements, and network bandwidth. Improper throttling can disrupt your business operations.

    Files Migrated Per Second

    No

    Select the number of files migrated per second.

    • Default: Uses the default rate for files migrated per second.

    • Specify an upper limit: Specify a maximum number of files migrated per second.

    Important
    • The actual number of files migrated per second is affected by factors such as the data source, network conditions, destination throttling, and file size, and may not reach the specified upper limit.

    • Select a value based on your data source, destination, business requirements, and network bandwidth. Improper throttling can disrupt your business operations.

    Overwrite Mode

    No

    Specifies how to handle files with the same name.

    • Do not overwrite: Skips the file.

    • Overwrite All: The source file overwrites the destination file.

    • Overwrite based on the last modification time:

      • If the last modified time of the source file is later than that of the destination file, the destination file is overwritten.

      • If the last modified time of the source and destination files are the same, the destination file is overwritten if their Size or Content-Type differs.

    • Warning
      • With the Overwrite based on the last modification time policy, there is a risk that an older file may overwrite a newer file because it does not strictly guarantee that newer files will be preserved.

      • If you select the Overwrite based on the last modification time policy, ensure that the source files can return metadata such as last modified time, Size, and Content-Type. Otherwise, the overwrite policy may not work as expected.

      • When you select Do not overwrite or Overwrite if last modified time is later, the service sends one request to the source and one to the destination to retrieve metadata for the overwrite check. This incurs request fees at both the source and the destination.

    Audit settings

    Migration Report

    Yes

    Delivery method for the migration report.

    • Do not push (Default): The report is not pushed to the destination.

    • Push: The report is pushed to the destination LocalFS. The report path is described in Subsequent operations.

    Important
    • Pushing a migration report consumes storage space at the destination.

    • Report delivery may be delayed. Wait for the report to be generated.

    • Each task execution has a unique ID. Reports are pushed only once. Exercise caution when deleting reports.

    Migration Logs

    Yes

    Specifies how to push the migration log.

    • Do not push (Default): Does not push the migration log.

    • Push: Pushes the migration log to Log Service (SLS). You can view the migration log in SLS.

    • Push only file error logs.: Pushes only file error logs to Log Service (SLS). You can view these logs in SLS.

    When you select Push or Push only file error logs., Online Migration Service creates a project in Log Service (SLS) named aliyun-oss-import-log-<Alibaba Cloud account ID>-<current deployment region>, for example, aliyun-oss-import-log-137918634953****-cn-hangzhou.

    Important

    Before you select Push or Push only file error logs., ensure you have completed the following operations. Otherwise, the migration task may fail.

    • You have activated Log Service (SLS).

    • You have granted the required permissions on the Authorize page.

    Authorize

    No

    This option appears only when you set Migration Logs to Push or Push only file error logs..

    Click Authorize to go to the Cloud Resource Access Authorization page. The system creates the AliyunOSSImportSlsAuditRole role and grants it the necessary permissions. Click Agree to Authorization to complete the authorization.

    Filters

    File Name

    No

    A filter based on filenames.

    Supports Include and Exclude rules using regular expressions based on the RE2 library (only a subset of the syntax is supported). For example:

    • .*\.jpg$ matches all files that end with .jpg.

    • ^file.* matches all files at the root level that start with file by default.

      If you set a prefix for the source address, such as data/to/oss/, you must use ^data/to/oss/file.* to match all files that start with file under that prefix.

    • .*/picture/.* matches any subdirectory named picture.

    Important
    • When you use an Include rule, all matching files are migrated. If there are multiple Include rules, any file that matches at least one rule is migrated.

      For example, if you have two files, picture.jpg and picture.png, and you set an Include rule for .*\.jpg$, only picture.jpg is migrated. If you also add an Include rule for .*\.png$, both files are migrated.

    • When you use an Exclude rule, no matching files are migrated. If there are multiple Exclude rules, any file that matches at least one rule is not migrated.

      For example, if you have two files, picture.jpg and picture.png, and you set an Exclude rule for .*\.jpg$, only picture.png is migrated. If you also add an Exclude rule for .*\.png$, neither file is migrated.

    • Exclude rules take precedence. If a file matches both an Exclude rule and an Include rule, the file is not migrated.

      For example, for a file named file.txt, if you set an Exclude rule for .*\.txt$ and an Include rule for file.*, the file file.txt is not migrated.

    File Modification Time

    No

    Filters files based on their last modified time.

    You can specify a time range to migrate only files whose last modified time falls within that range. The rules are as follows:

    • If you specify only a start time of January 1, 2019, the task migrates only files last modified on or after that date.

    • If you specify only an end time of January 1, 2022, the task migrates only files last modified on or before that date.

    • If you specify a start time of January 1, 2019 and an end time of January 1, 2022, the task migrates only files last modified on or between these two dates.

    Migrate special entities

    No

    Controls whether special entity types are migrated.

    Symbolic link:

    • Enabled: Source symbolic links are added to the migration queue and counted in file and storage statistics. Corresponding symbolic link files are created at the destination with attributes based on migratable UserMeta attributes. The Target attribute depends on the Convert target option.

    • Disabled: Source symbolic links are ignored and excluded from file count and storage statistics.

    Important

    Objects that symbolic links point to are not automatically migrated. They migrate only if included in the task scope.

    Migration configuration

    Convert target

    No

    Controls whether the Target attribute of source symbolic links is converted to ensure migrated links point to correct target files.

    Important
    • This option takes effect only when symbolic link migration is enabled.

    • Regardless of whether the target is converted, the migration service does not check if the target file exists, if its type is valid, or if you have the required access permissions.

    Enabled: A string replacement is performed. If the Target attribute of the source symbolic link matches the source prefix (SrcPrefix), the prefix is replaced with the destination prefix (DestPrefix). The result is set as the Target attribute for the destination symbolic link.

    Note

    Example: Assume a migration task is configured with SrcPrefix="cloud_base/" and DestPrefix="/mnt/nas1/". A source symbolic link object exists at cloud_base/links/a.lnk.

    • If its Target attribute is "cloud_base/data/a.txt", the replacement matches. The final Target at the destination will be "/mnt/nas1/data/a.txt".

    • If its Target attribute is "cloud_outer/data/a.txt", no match is found. The final Target at the destination remains "cloud_outer/data/a.txt".

    Disabled: No conversion is performed. The original Target attribute from the source symbolic link is set on the destination symbolic link.

    Preserve last modification time

    Yes

    Controls whether the last modification time of the source file is preserved.

    • Preserve (Default): The last modification time of the source file is set on the destination file.

    • Do not preserve: The last modification time is not preserved.

    Task scheduling

    Execution time

    No

    Important
    1. If a migration task is still running at its next scheduled execution time, that execution is postponed until the next scheduled time after the current run completes. This continues until the specified number of executions is reached.

    2. Concurrency limit for migration tasks: Deployment regions in the Chinese mainland and China (Hong Kong) support a maximum of 10 concurrent tasks. Overseas regions support a maximum of 5 concurrent tasks. Exceeding this limit may cause scheduled tasks to fail.

    Defines when to run the migration task.

    • Immediately: Runs the task as soon as it is created.

    • At the Specified Time: Specifies a daily time window for the task to run. By default, the task starts at the specified start time and pauses at the specified stop time.

    • Periodic Scheduling: Runs the task based on a specified frequency and number of executions.

      • Execution frequency: Supports five types of frequencies: Hourly, Daily, Weekly, Specific days of the week, and Custom. For more information, see Execution frequency reference.

      • Number of executions: Specifies how many times the task runs. If not set, the task runs once by default. For the maximum number of executions, refer to the console prompt.

    Important

    You can manually start and stop tasks at any time, regardless of the custom execution time settings.

  4. Read the Online Migration Service Agreement, select I understand and confirm the compliance commitment statement and acknowledge my responsibility to verify data consistency after the migration task is complete, and then click Next.

  5. Review your configuration settings. If everything is correct, click OK and wait for the migration task to run.

Execution frequency

Execution frequency

Description

Example

Hourly

Run the task once every hour. You can use this option with the maximum number of runs.

The current time is 8:05. The frequency is set to hourly with a maximum of 3 runs. The first run starts at the next hour, 9:00.

  • If a run finishes before the next hour, the second run starts at 10:00. This pattern continues until the specified number of runs is complete.

  • If a run has not finished by the next hour and ends at 12:30, the second run starts at the next hour, 13:00. This pattern continues until the specified number of runs is complete.

Daily

Run the task once a day. You must specify an hour (0-23) for the task to start. You can use this option with the maximum number of runs.

The current time is 8:05. The task is scheduled to run daily at 10:00, with a maximum of 5 runs. The first run starts at 10:00 today.

  • If a run finishes before 10:00 the next day, the second run starts at 10:00 the next day. This pattern continues until the specified number of runs is complete.

  • If a run has not finished by 10:00 the next day and ends at 12:05 the next day, the second run starts at 10:00 on the third day. This pattern continues until the specified number of runs is complete.

Weekly

Run the task once a week. You must specify a day of the week and an hour (0-23) for the task to start. You can use this option with the maximum number of runs.

The current time is Monday, 8:05. The task is scheduled to run every Monday at 10:00, with a maximum of 10 runs. The first run starts at 10:00 today.

  • If a run finishes before 10:00 next Monday, the second run starts at 10:00 next Monday. This pattern continues until the specified number of runs is complete.

  • If a run has not finished by 10:00 next Monday and ends at 12:05 next Monday, the second run starts at 10:00 on the following Monday. This pattern continues until the specified number of runs is complete.

Specific days of the week

Run the task on selected days of the week. You must specify the days and an hour (0-23) for the task to start.

The current time is Wednesday, 8:05. The task is scheduled to run on Mondays, Wednesdays, and Fridays at 10:00. The first run starts at 10:00 today.

  • If a run finishes before 10:00 on Friday, the second run starts at 10:00 on Friday. This pattern continues until the specified number of runs is complete.

  • If a run has not finished by 10:00 on Friday and ends at 12:05 next Monday, the second run starts at 10:00 next Wednesday. This pattern continues until the specified number of runs is complete.

Custom

Use a cron expression to define a custom schedule for the task start time.

Note

A cron expression consists of six space-separated fields that define the execution schedule: second, minute, hour, day of the month, month, and day of the week. The minimum interval is 1 hour.

The following cron expression examples are for reference only. For more options, use a cron expression generator.

  • 0 0 * * * *: Runs the task at the beginning of every hour (0 minutes, 0 seconds).

  • 0 30 0/3 * * ?: Runs the task every 3 hours at 30 minutes past the hour (for example, at 0:30, 3:30, 6:30, 9:30, 12:30, 15:30, 18:30, and 21:30).

  • 0 0 12 * * MON-FRI: Runs the task at 12:00 PM every weekday from Monday to Friday.

  • 0 0 12 1-15 * SAT,SUN: Runs the task at 12:00 PM on weekends (Saturday and Sunday) that fall between the 1st and 15th of the month.

  • 0 30 8 1,15 * *: Runs the task at 8:30 AM on the 1st and 15th of each month.

Step 7: Verify data

The migration service only transfers your data and does not guarantee data consistency or integrity. After the migration task completes, you must verify data consistency between the source and the destination.

Warning

After the migration task completes, you must verify the data at the destination. Verify that all of your data has been completely migrated to the destination before deleting the source data. If you delete the source data without verifying it, you are responsible for any resulting data loss.