Business data is often scattered across on-premises data centers, third-party cloud storage, and Alibaba Cloud OSS buckets in different regions and accounts. Scattered data makes operations complex and increases costs. Data migration consolidates this data into a destination OSS bucket, and Alibaba Cloud provides methods such as Data Online Migration, command line tools, and Data Transport for different migration scenarios.
Considerations
Before you plan a migration to OSS, review the following requirements:
Transfer acceleration — If the source region and the destination region span the Chinese mainland and regions outside the Chinese mainland, you must enable transfer acceleration.
S3-compatible API — Enable the S3-compatible API on a self-managed object storage service, such as OpenStack Swift, before you migrate its data to OSS.
OSS-HDFS activation — Activate OSS-HDFS before you migrate data between OSS-HDFS buckets.
Migration method by data source
The following table maps each migration source to the recommended method. The sections after the table describe the conditions and the capabilities of each method.
| Migration source | Condition | Recommended method |
| OSS bucket | Same region, same account, small to medium amounts of data | ossutil |
| OSS bucket | Same region, different accounts or large amounts of data | Same-region replication |
| OSS bucket | Different regions | Cross-region replication |
| Third-party cloud storage or self-managed S3-compatible object storage | Managed migration without environment setup | Data Online Migration |
| On-premises file system | Less than 5 GB | Upload in the OSS console |
| On-premises file system | Medium amounts of data, such as regular business data, log files, or backup data | ossutil |
| On-premises file system | Medium amounts of data, complex on-premises network, or centralized task management | Data Online Migration |
| On-premises file system | Large amounts of data transferred over the Internet | Data Online Migration |
| On-premises file system | Large amounts of data limited by Internet bandwidth, or an entire data center | Data Transport |
| HTTP/HTTPS sources | Batch download from a list of URLs | Data Online Migration |
| HDFS | Destination is OSS | Jindo DistCp |
| HDFS | Destination is OSS-HDFS | Jindo DistCp |
| OSS-HDFS bucket | Destination is another OSS-HDFS bucket | Jindo DistCp |
| Semi-managed JindoFS cluster | Destination is OSS-HDFS | JindoDistJob |
| Hive tables and partition data | Destination is OSS-HDFS | JindoTable MoveTo |
| OSS foreign tables (gpossext) | Parallel import and export between a data warehouse and OSS | gpossext |
Migration between Alibaba Cloud OSS buckets
When you migrate data between Alibaba Cloud OSS buckets, select a migration method based on whether the source bucket and the destination bucket reside in the same region.
Migration within the same region
When the source bucket and the destination bucket reside in the same region, select a migration method based on your scenario:
ossutil — For small to medium amounts of data in buckets that belong to the same account, use the ossutil command line tool to copy objects between buckets. ossutil supports batch object copy and resumable transfer.
Same-region replication — For large amounts of data or for migration between buckets that belong to different accounts, use same-region replication. Data is not downloaded to an intermediate location and no extra network transfer is required. When objects are added, modified, or deleted in the source bucket, the changes are automatically synchronized to the destination bucket. This method suits scenarios in which data is centralized and shared across teams or subsidiaries.
Migration across regions
When the source bucket and the destination bucket reside in different regions, for example when you migrate data from China (Hangzhou) to China (Beijing), use cross-region replication. Data is transferred over the internal network of Alibaba Cloud. Replication is continuous: object additions, modifications, and deletions in the source bucket are synchronized to the destination bucket automatically. This method suits multi-site collaboration and real-time backup scenarios.
Storage region changes for resource plans
If you need to switch storage regions due to regional restrictions on resource plans, migrate data to the bucket in the destination region by using cross-region replication or ossutil. Cross-region replication is configured on the source bucket. After the migration is complete, purchase a resource plan in the destination region, because a purchased resource plan cannot be transferred to a different region.
Migration from a decommissioned region
When a bucket resides in a region that is being decommissioned, such as China (Nanjing - Local Region), use cross-region replication to migrate data to a bucket in another available region. Cross-region replication is billed based on replication traffic. For CRR across accounts, the account to which the source bucket belongs bears the cost.
Cross-region replication does not automatically delete data from the source bucket. After you confirm that the migration is complete, manually delete the source data based on your business requirements. If the account balance is insufficient during data transfer, replication tasks may be interrupted or fail. Make sure that your account has a sufficient balance before you start the migration.
Migration from third-party or self-managed object storage to OSS
Data Online Migration migrates data from another object storage service to Alibaba Cloud OSS without a self-built migration environment.
Third-party cloud storage services
To migrate data that is stored with another cloud service provider to Alibaba Cloud OSS, use Data Online Migration. Storage services such as AWS S3, Tencent Cloud COS, Huawei Cloud OBS, Volcengine TOS, Google Cloud GCS, and Microsoft Azure Blob are supported. You do not need to set up a migration environment. You can submit migration tasks online and monitor the migration progress at any time. Migration tasks support file filtering: you can filter the files to migrate by file name, with RE2 regular expressions, and by last modified time. For the procedure that matches your business scenario, see the Data Online Migration tutorial.
Self-managed S3-compatible object storage
Data Online Migration also supports self-managed object storage services that are compatible with the S3 protocol, such as OpenStack Swift with the S3-compatible API enabled.
Migration from an on-premises file system to OSS
Small amounts of data
For less than 5 GB of data, upload the data directly in the OSS console. This method requires no additional tools or complex configurations, and you can upload files in the browser. It suits temporary file uploads, test data migration, infrequent migration tasks, and scattered files.
Medium amounts of data
To migrate a medium amount of data, select one of the following methods based on your requirements:
ossutil — To transfer regular business data, log files, or backup data, use the ossutil command line tool to upload local files to OSS. ossutil supports batch uploads, resumable transfer, and concurrent acceleration.
Data Online Migration — If your on-premises network is complex, or if you manage migration tasks centrally in the cloud, use Data Online Migration to migrate data from LocalFS to OSS. This managed migration solution supports task creation, monitoring, and management, which reduces operations complexity. It suits enterprise customers that need centralized control over the migration process.
Large amounts of data
To migrate a large amount of data, select one of the following methods based on your requirements:
Data Online Migration — Use Data Online Migration when the data can be transferred over the Internet. You do not need to set up a migration environment, and you can submit migration tasks online and monitor the migration progress in real time. This method suits business scenarios that require flexible scheduling.
Data Transport — If your data transfer is limited by Internet bandwidth, or if you migrate data from an on-premises data center, use Data Transport. Data Transport is designed for migration of TB-scale to PB-scale data. Data is collected and transferred on physical devices, which removes the Internet bandwidth bottleneck. This method suits scenarios such as migrating an entire data center to the cloud, enterprise archive files, and historical image data.
Migration from HTTP/HTTPS sources to OSS
If your data is stored at HTTP/HTTPS sources, use Data Online Migration to migrate data from HTTP/HTTPS sources to OSS. You do not need to set up an additional environment. Submit the migration task online, and then monitor the task progress and status in real time.
OSS does not provide an API operation that pulls a single file directly from a URL. All upload operations, such as PutObject, Multipart Upload, and AppendObject, upload data from the client, and OSS does not pull files from a remote URL on the server side. The AsyncFetch feature, which previously pulled files from a URL on the server side, is no longer available for activation, and new accounts cannot use it.
Single file — To store a file from a remote URL in OSS, download the file to your computer. Then, upload it by using an operation such as PutObject.
Multiple files — To pull files from multiple HTTP/HTTPS URLs to OSS, use Data Online Migration to create a migration task for HTTP/HTTPS sources. Then, use a manifest file that contains the list of URLs to download and migrate the files in batches.
Migration from big data storage to OSS
HDFS data to OSS
For large amounts of data in a Hadoop Distributed File System (HDFS), use Jindo DistCp to migrate HDFS data to OSS. Jindo DistCp is a distributed file copy tool that is based on MapReduce and transfers files within a large cluster or between clusters. Jindo DistCp uses the file and directory lists as the input of a MapReduce job and splits the job into parallel tasks. Each task copies part of the data in the source list. Jindo DistCp supports fault tolerance, resumable transfer, and error recovery to maintain stability and data integrity in TB-scale or even PB-scale migration. This tool suits scenarios such as big data computing and data lake construction.
Data exchange between OSS and AnalyticDB for PostgreSQL
If your data is stored as OSS foreign tables (gpossext) and you need to import and export data between OSS and a data warehouse, use AnalyticDB for PostgreSQL: export data to OSS in parallel. The gpossext feature imports data from OSS to AnalyticDB for PostgreSQL in parallel, or exports data to OSS in parallel. Based on a distributed architecture, the migration provides high concurrency and high throughput capacity, which shortens the transfer time and maintains data security and data integrity. This method suits scenarios such as large-scale data analytics, historical data archiving, and cross-system data exchange.
Migration from big data storage to OSS-HDFS
OSS-HDFS, also known as JindoFS, is a cloud-native data lake storage service. Based on unified metadata management, OSS-HDFS is fully compatible with the HDFS API and provides complete POSIX support. OSS-HDFS suits data lake scenarios such as big data computing and AI training. Select OSS-HDFS instead of OSS as the migration destination when your big data workloads depend on HDFS API compatibility or POSIX semantics. The following sections describe how to migrate existing data to OSS-HDFS and how to migrate data between OSS-HDFS buckets.
Traditional HDFS clusters to OSS-HDFS
To migrate data from a traditional HDFS cluster, use Jindo DistCp to migrate HDFS data to OSS-HDFS. This tool distributes large numbers of files within a cluster or across clusters and supports automatic error detection, retries, and task recovery, which improves the stability of migration tasks. Jindo DistCp uses the file and directory lists as the input of a MapReduce job, and each task copies part of the files. This approach suits migration of massive amounts of data in batches.
Data between OSS-HDFS buckets
To migrate data from one OSS-HDFS bucket to another, use Jindo DistCp to migrate data between OSS-HDFS buckets. This method suits requirements such as adjusting data partitions, optimizing storage resources, and scheduling data across regions, and it keeps business data consistent and highly available.
Semi-managed JindoFS clusters to OSS-HDFS
If you use a semi-managed JindoFS cluster, use JindoDistJob to migrate data from a semi-managed JindoFS cluster to OSS-HDFS. This tool supports full migration and incremental migration, and it switches to the JindoFS service-based solution without migrating data blocks. The migration does not affect your business, which suits scenarios in which you need to switch the storage architecture quickly.
Hive tables and partition data to OSS-HDFS
To migrate structured data, use the JindoTable MoveTo command to migrate Hive tables and partition data to OSS-HDFS. After the underlying data is copied, the command automatically updates the metadata so that the tables and partitions are fully migrated to the new path. The command supports filter conditions, migrates a large number of partitions at a time, and uses multiple data validation mechanisms to maintain data integrity and data security. This command suits migration of large structured datasets.
Zero-downtime migration with mirroring-based back-to-origin
To maintain business continuity during a migration, configure mirroring-based back-to-origin. After you switch your service to OSS, OSS automatically retrieves data that has not been migrated from the origin when the data is requested. The transition stays transparent to your users.
Determine the migration method first. Then, configure mirroring-based back-to-origin based on your business requirements to achieve zero-downtime migration.
A typical zero-downtime migration runs in the following order:
Migrate historical data to the destination OSS bucket.
Switch the service entry to OSS.
Mirroring-based back-to-origin retrieves the data that has not been migrated when clients request it. The data is backfilled gradually until all data is stored in the cloud.
For example, a service runs on another cloud storage platform and must be migrated to OSS as the business grows, but the online service cannot be stopped. In this case, configure mirroring-based back-to-origin rules to automatically fetch data that has not been migrated and synchronize the data to OSS during the migration. The service stays available and stable.