[Object Storage Service (OSS)] Data Backup and Migration to AliBaba Cloud OSS using OSSImport

OSSImport is a free tool created by the Alibaba Cloud product team to assist with data backup and migration into the Alibaba Cloud Object Storage Service (OSS). Using OSSImport data can be migrated from either local storage or from third party cloud platforms. Currently supported data sources include Qiniu, Baidu BOS, AWS S3, Azure Blob, Youpai Cloud, Tencent Cloud COS, Kingsoft KS3, HTTP, and other OSS buckets.

Prerequisites

  • Java
    Install Java which is a pre-requisite to using the OSSImport tool.

    1
    2
    3
    4
    # CentOS
    $ sudo yum install -y java-1.8.0-openjdk

    $ sudo yum install -y curl unzip
  • curl, unzip

    1
    2
    # CentOS
    yum install -y curl unzip

Insallaion

Download the OSSImport tool using the following ‘curl’ command

1
curl -o ./ossimport.zip http://gosspublic.alicdn.com/ossimport/standalone/ossimport-2.3.1.zip?spm=a2c63.p38356.a3.3.48ce6605cjP9sM&file=ossimport-2.3.1.zip

When the download finishes – unzip the archive using the following ‘unzip’ command

1
unzip ossimport.zip -d ./ossimport

Configuraion

Edit the local_job.cfg configuration file located at “./ossimport/conf/local_job.cfg” using an editor of your choice – ensure the following fields are updated:

Local

1
2
3
4
5
6
7
8
9
10
11
srcType=local

# Note: The srcPrefix setting is where you specific a directory where local files are stored to be migrated to OSS. In a Linux/Unix environment this must end with a "/" (Ex: /Users/username/Documents/)
srcPrefix=<LOCAL DIRECTORY FOR FILES>

# Note: Alibaba Cloud Access and Secret key can be obtained from within the portal "Account Management" -> "Access Keys"
destAccessKey=<ALIBABA CLOUD ACCESS KEY>
destSecretKey=<ALIBABA CLOUD SECRET KEY>

# Note: The Alibaba Cloud OSS address can be found within the OSS portal, because the source machine is not within the same network the "Internet Access" endpoint address must be used.
destDomain=<ALIBABA CLOUD OSS ADDRESS>

Run

1
bash import.sh

See files whthin the logs/ directory to more information after running.

Known Issues

JDK Version

JDK version must be 7 or 8, otherwise will throw an exception.

1
java.lang.ClassNotFoundException: javax.xml.bind.JAXBException

Reference

[1] Data Backup and Migration to OSS using OSSImport - https://www.alibabacloud.com/blog/data-backup-and-migration-to-oss-using-ossimport_594320

[2] 说明及配置_数据迁移工具ossimport_常用工具_对象存储 OSS-阿里云 - https://help.aliyun.com/document_detail/56990.html?spm=a2c4g.11186623.2.14.783340afwo9Yqx#concept-rc2-t1h-wdb

[3] OSS跨账号复制工具ossimport尝试 · 语雀 - https://g.yuque.com/bzxr/aliyun/vzvblv?language=en-us