跨服务对象存储迁移工具介绍

如果你有多个对象存储数据迁移需求可继续往下看

Introduction

  1. 项目地址https://github.com/hanskorg/osstransfer
  2. 本项目实现了 七牛云存储、阿里云OSS、腾讯COS 对象存储迁移功能
  3. 支持多bucket、任务状态保存恢复

使用方法

初始化数据库

SQL: src/main/resources/transfer.sql

配置

1
### 修改配置 config/application.yml

spring:
datasource:
#mysql 配置
url: jdbc:mysql://localhost:3306/oss_transfer
username: root
password: 123456
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
filters: stat
maxActive: 20
initialSize: 1
maxWait: 60000
minIdle: 1
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: select 1
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 2
mybatis:
mapper-locations: classpath:mapping/*.xml
type-aliases-package: org.hansk.tools.transfer.domain
oss:

OSS 配置文件

key: key
secret: secret
end_point: http://endpoint #endpooint 查看阿里云文档
timeout: 1000
buckets: # bucket列表

  • testbucket1
  • testbucket2

最大下载数量

core_download: 2
max_download: 10

qiniu:
# 七牛存储配置
access_key: qiniukey
secret_key: qiniusecret

1

评论