AWS有很多服务可以迁移S3数据,如AWS DataSync、DTH,考虑到成本且为同区域不同账户间的S3数据迁移,所以采用Rclone

一. 什么是Rclone

Rclone是一个跨平台,跨云存储的命令行工具,可以轻松地同步本地文件和云存储。

二. 迁移前准备

本次实验中,源桶为"source-bucket-132",目标桶为"destination-bucket-132",都在us-east-1,以避免跨区域复制产生的费用

1.在源AWS账号中创建IAM用户,附加S3读取权限,并生成AKSK

打开IAM控制台,在访问管理中选择用户,并创建"demoRcloneDemo"IAM用户(无需控制台权限),直接附加策略"AmazonS3ReadOnlyAccess",账号创建完成后,务必新建该用户的AKSK并记录(后续迁移过程会使用)
2.1-createIAMUser.png

2.在目标AWS账号中创建IAM角色,附加S3Full权限

打开IAM控制台,在访问管理中选择角色进行创建,可信任实体选择"EC2",权限选择"AmazonS3FullAccess",角色名称为"demoRcloneDemo"
2.2-createIAMRole.png

3.根据实际业务需求以及数据量启动适当的linux ec2实例

打开EC2控制台,选择"Launch Instance",选择"AmazonLinux2023"镜像,选择"t2.micro"实例类型,选择"demoRcloneDemo"IAM角色,启动实例
若在创建EC2过程中,未选择IAM角色,可在EC2控制台界面修改EC2实例的IAM角色
2.3-addEC2IAMRole.png

三. 迁移数据

1.安装rclone工具

连接到EC2实例,使用ec2-user用户登录,执行以下命令安装rclone工具

1
sudo -v ; curl https://rclone.org/install.sh | sudo bash

2.配置源

使用以下命令配置源账号信息,注意提示信息

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
[root@demo ec2-user]# rclone config 
2024/08/09 04:12:19 NOTICE: Config file "/root/.config/rclone/rclone.conf" not found - using defaults
No remotes found, make a new one?
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n

Enter name for new remote.
name> source

Option Storage.
Type of storage to configure.
Choose a number from below, or type in your own value.
1 / 1Fichier
\ (fichier)
2 / Akamai NetStorage
\ (netstorage)
3 / Alias for an existing remote
\ (alias)
4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, ChinaMobile, Cloudflare, DigitalOcean, Dreamhost, GCS, HuaweiOBS, IBMCOS, IDrive, IONOS, LyveCloud, Leviia, Liara, Linode, Magalu, Minio, Netease, Petabox, RackCorp, Rclone, Scaleway, SeaweedFS, StackPath, Storj, Synology, TencentCOS, Wasabi, Qiniu and others
\ (s3)
5 / Backblaze B2
\ (b2)
6 / Better checksums for other remotes
\ (hasher)
7 / Box
\ (box)
8 / Cache a remote
\ (cache)
9 / Citrix Sharefile
\ (sharefile)
10 / Combine several remotes into one
\ (combine)
11 / Compress a remote
\ (compress)
12 / Dropbox
\ (dropbox)
13 / Encrypt/Decrypt a remote
\ (crypt)
14 / Enterprise File Fabric
\ (filefabric)
15 / FTP
\ (ftp)
16 / Google Cloud Storage (this is not Google Drive)
\ (google cloud storage)
17 / Google Drive
\ (drive)
18 / Google Photos
\ (google photos)
19 / HTTP
\ (http)
20 / Hadoop distributed file system
\ (hdfs)
21 / HiDrive
\ (hidrive)
22 / ImageKit.io
\ (imagekit)
23 / In memory object storage system.
\ (memory)
24 / Internet Archive
\ (internetarchive)
25 / Jottacloud
\ (jottacloud)
26 / Koofr, Digi Storage and other Koofr-compatible storage providers
\ (koofr)
27 / Linkbox
\ (linkbox)
28 / Local Disk
\ (local)
29 / Mail.ru Cloud
\ (mailru)
30 / Mega
\ (mega)
31 / Microsoft Azure Blob Storage
\ (azureblob)
32 / Microsoft Azure Files
\ (azurefiles)
33 / Microsoft OneDrive
\ (onedrive)
34 / OpenDrive
\ (opendrive)
35 / OpenStack Swift (Rackspace Cloud Files, Blomp Cloud Storage, Memset Memstore, OVH)
\ (swift)
36 / Oracle Cloud Infrastructure Object Storage
\ (oracleobjectstorage)
37 / Pcloud
\ (pcloud)
38 / PikPak
\ (pikpak)
39 / Proton Drive
\ (protondrive)
40 / Put.io
\ (putio)
41 / QingCloud Object Storage
\ (qingstor)
42 / Quatrix by Maytech
\ (quatrix)
43 / SMB / CIFS
\ (smb)
44 / SSH/SFTP
\ (sftp)
45 / Sia Decentralized Cloud
\ (sia)
46 / Storj Decentralized Cloud Storage
\ (storj)
47 / Sugarsync
\ (sugarsync)
48 / Transparently chunk/split large files
\ (chunker)
49 / Uloz.to
\ (ulozto)
50 / Union merges the contents of several upstream fs
\ (union)
51 / Uptobox
\ (uptobox)
52 / WebDAV
\ (webdav)
53 / Yandex Disk
\ (yandex)
54 / Zoho
\ (zoho)
55 / premiumize.me
\ (premiumizeme)
56 / seafile
\ (seafile)
Storage> s3

Option provider.
Choose your S3 provider.
Choose a number from below, or type in your own value.
Press Enter to leave empty.
1 / Amazon Web Services (AWS) S3
\ (AWS)
2 / Alibaba Cloud Object Storage System (OSS) formerly Aliyun
\ (Alibaba)
3 / Arvan Cloud Object Storage (AOS)
\ (ArvanCloud)
4 / Ceph Object Storage
\ (Ceph)
5 / China Mobile Ecloud Elastic Object Storage (EOS)
\ (ChinaMobile)
6 / Cloudflare R2 Storage
\ (Cloudflare)
7 / DigitalOcean Spaces
\ (DigitalOcean)
8 / Dreamhost DreamObjects
\ (Dreamhost)
9 / Google Cloud Storage
\ (GCS)
10 / Huawei Object Storage Service
\ (HuaweiOBS)
11 / IBM COS S3
\ (IBMCOS)
12 / IDrive e2
\ (IDrive)
13 / IONOS Cloud
\ (IONOS)
14 / Seagate Lyve Cloud
\ (LyveCloud)
15 / Leviia Object Storage
\ (Leviia)
16 / Liara Object Storage
\ (Liara)
17 / Linode Object Storage
\ (Linode)
18 / Magalu Object Storage
\ (Magalu)
19 / Minio Object Storage
\ (Minio)
20 / Netease Object Storage (NOS)
\ (Netease)
21 / Petabox Object Storage
\ (Petabox)
22 / RackCorp Object Storage
\ (RackCorp)
23 / Rclone S3 Server
\ (Rclone)
24 / Scaleway Object Storage
\ (Scaleway)
25 / SeaweedFS S3
\ (SeaweedFS)
26 / StackPath Object Storage
\ (StackPath)
27 / Storj (S3 Compatible Gateway)
\ (Storj)
28 / Synology C2 Object Storage
\ (Synology)
29 / Tencent Cloud Object Storage (COS)
\ (TencentCOS)
30 / Wasabi Object Storage
\ (Wasabi)
31 / Qiniu Object Storage (Kodo)
\ (Qiniu)
32 / Any other S3 compatible provider
\ (Other)
provider> 1

Option env_auth.
Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
Only applies if access_key_id and secret_access_key is blank.
Choose a number from below, or type in your own boolean value (true or false).
Press Enter for the default (false).
1 / Enter AWS credentials in the next step.
\ (false)
2 / Get AWS credentials from the environment (env vars or IAM).
\ (true)
env_auth> 1

Option access_key_id.
AWS Access Key ID.
Leave blank for anonymous access or runtime credentials.
Enter a value. Press Enter to leave empty.
access_key_id> AKIAW3MD7HTUZGPE73VN

Option secret_access_key.
AWS Secret Access Key (password).
Leave blank for anonymous access or runtime credentials.
Enter a value. Press Enter to leave empty.
secret_access_key> Z8cMEE07WezBErUOM94hflt36E3doFwvFTAOaC5C

Option region.
Region to connect to.
Choose a number from below, or type in your own value.
Press Enter to leave empty.
/ The default endpoint - a good choice if you are unsure.
1 | US Region, Northern Virginia, or Pacific Northwest.
| Leave location constraint empty.
\ (us-east-1)
/ US East (Ohio) Region.
2 | Needs location constraint us-east-2.
\ (us-east-2)
/ US West (Northern California) Region.
3 | Needs location constraint us-west-1.
\ (us-west-1)
/ US West (Oregon) Region.
4 | Needs location constraint us-west-2.
\ (us-west-2)
/ Canada (Central) Region.
5 | Needs location constraint ca-central-1.
\ (ca-central-1)
/ EU (Ireland) Region.
6 | Needs location constraint EU or eu-west-1.
\ (eu-west-1)
/ EU (London) Region.
7 | Needs location constraint eu-west-2.
\ (eu-west-2)
/ EU (Paris) Region.
8 | Needs location constraint eu-west-3.
\ (eu-west-3)
/ EU (Stockholm) Region.
9 | Needs location constraint eu-north-1.
\ (eu-north-1)
/ EU (Milan) Region.
10 | Needs location constraint eu-south-1.
\ (eu-south-1)
/ EU (Frankfurt) Region.
11 | Needs location constraint eu-central-1.
\ (eu-central-1)
/ Asia Pacific (Singapore) Region.
12 | Needs location constraint ap-southeast-1.
\ (ap-southeast-1)
/ Asia Pacific (Sydney) Region.
13 | Needs location constraint ap-southeast-2.
\ (ap-southeast-2)
/ Asia Pacific (Tokyo) Region.
14 | Needs location constraint ap-northeast-1.
\ (ap-northeast-1)
/ Asia Pacific (Seoul).
15 | Needs location constraint ap-northeast-2.
\ (ap-northeast-2)
/ Asia Pacific (Osaka-Local).
16 | Needs location constraint ap-northeast-3.
\ (ap-northeast-3)
/ Asia Pacific (Mumbai).
17 | Needs location constraint ap-south-1.
\ (ap-south-1)
/ Asia Pacific (Hong Kong) Region.
18 | Needs location constraint ap-east-1.
\ (ap-east-1)
/ South America (Sao Paulo) Region.
19 | Needs location constraint sa-east-1.
\ (sa-east-1)
/ Israel (Tel Aviv) Region.
20 | Needs location constraint il-central-1.
\ (il-central-1)
/ Middle East (Bahrain) Region.
21 | Needs location constraint me-south-1.
\ (me-south-1)
/ Africa (Cape Town) Region.
22 | Needs location constraint af-south-1.
\ (af-south-1)
/ China (Beijing) Region.
23 | Needs location constraint cn-north-1.
\ (cn-north-1)
/ China (Ningxia) Region.
24 | Needs location constraint cn-northwest-1.
\ (cn-northwest-1)
/ AWS GovCloud (US-East) Region.
25 | Needs location constraint us-gov-east-1.
\ (us-gov-east-1)
/ AWS GovCloud (US) Region.
26 | Needs location constraint us-gov-west-1.
\ (us-gov-west-1)
region> 1

Option endpoint.
Endpoint for S3 API.
Leave blank if using AWS to use the default endpoint for the region.
Enter a value. Press Enter to leave empty.
endpoint>

Option location_constraint.
Location constraint - must be set to match the Region.
Used when creating buckets only.
Choose a number from below, or type in your own value.
Press Enter to leave empty.
1 / Empty for US Region, Northern Virginia, or Pacific Northwest
\ ()
2 / US East (Ohio) Region
\ (us-east-2)
3 / US West (Northern California) Region
\ (us-west-1)
4 / US West (Oregon) Region
\ (us-west-2)
5 / Canada (Central) Region
\ (ca-central-1)
6 / EU (Ireland) Region
\ (eu-west-1)
7 / EU (London) Region
\ (eu-west-2)
8 / EU (Paris) Region
\ (eu-west-3)
9 / EU (Stockholm) Region
\ (eu-north-1)
10 / EU (Milan) Region
\ (eu-south-1)
11 / EU Region
\ (EU)
12 / Asia Pacific (Singapore) Region
\ (ap-southeast-1)
13 / Asia Pacific (Sydney) Region
\ (ap-southeast-2)
14 / Asia Pacific (Tokyo) Region
\ (ap-northeast-1)
15 / Asia Pacific (Seoul) Region
\ (ap-northeast-2)
16 / Asia Pacific (Osaka-Local) Region
\ (ap-northeast-3)
17 / Asia Pacific (Mumbai) Region
\ (ap-south-1)
18 / Asia Pacific (Hong Kong) Region
\ (ap-east-1)
19 / South America (Sao Paulo) Region
\ (sa-east-1)
20 / Israel (Tel Aviv) Region
\ (il-central-1)
21 / Middle East (Bahrain) Region
\ (me-south-1)
22 / Africa (Cape Town) Region
\ (af-south-1)
23 / China (Beijing) Region
\ (cn-north-1)
24 / China (Ningxia) Region
\ (cn-northwest-1)
25 / AWS GovCloud (US-East) Region
\ (us-gov-east-1)
26 / AWS GovCloud (US) Region
\ (us-gov-west-1)
location_constraint> 1

Option acl.
Canned ACL used when creating buckets and storing or copying objects.
This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.
For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
Note that this ACL is applied when server-side copying objects as S3
doesn't copy the ACL from the source but rather writes a fresh one.
If the acl is an empty string then no X-Amz-Acl: header is added and
the default (private) will be used.
Choose a number from below, or type in your own value.
Press Enter to leave empty.
/ Owner gets FULL_CONTROL.
1 | No one else has access rights (default).
\ (private)
/ Owner gets FULL_CONTROL.
2 | The AllUsers group gets READ access.
\ (public-read)
/ Owner gets FULL_CONTROL.
3 | The AllUsers group gets READ and WRITE access.
| Granting this on a bucket is generally not recommended.
\ (public-read-write)
/ Owner gets FULL_CONTROL.
4 | The AuthenticatedUsers group gets READ access.
\ (authenticated-read)
/ Object owner gets FULL_CONTROL.
5 | Bucket owner gets READ access.
| If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.
\ (bucket-owner-read)
/ Both the object owner and the bucket owner get FULL_CONTROL over the object.
6 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.
\ (bucket-owner-full-control)
acl> 1

Option server_side_encryption.
The server-side encryption algorithm used when storing this object in S3.
Choose a number from below, or type in your own value.
Press Enter to leave empty.
1 / None
\ ()
2 / AES256
\ (AES256)
3 / aws:kms
\ (aws:kms)
server_side_encryption> 1

Option sse_kms_key_id.
If using KMS ID you must provide the ARN of Key.
Choose a number from below, or type in your own value.
Press Enter to leave empty.
1 / None
\ ()
2 / arn:aws:kms:*
\ (arn:aws:kms:us-east-1:*)
sse_kms_key_id>

Option storage_class.
The storage class to use when storing new objects in S3.
Choose a number from below, or type in your own value.
Press Enter to leave empty.
1 / Default
\ ()
2 / Standard storage class
\ (STANDARD)
3 / Reduced redundancy storage class
\ (REDUCED_REDUNDANCY)
4 / Standard Infrequent Access storage class
\ (STANDARD_IA)
5 / One Zone Infrequent Access storage class
\ (ONEZONE_IA)
6 / Glacier storage class
\ (GLACIER)
7 / Glacier Deep Archive storage class
\ (DEEP_ARCHIVE)
8 / Intelligent-Tiering storage class
\ (INTELLIGENT_TIERING)
9 / Glacier Instant Retrieval storage class
\ (GLACIER_IR)
storage_class> 1

Edit advanced config?
y) Yes
n) No (default)
y/n> n

Configuration complete.
Options:
- type: s3
- provider: AWS
- access_key_id: AKIAW3MD7HTUZGPE73VN
- secret_access_key: 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
- region: us-east-1
- acl: private
Keep this "source" remote?
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y

Current remotes:

Name Type
==== ====
source s3

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> q

3.配置目标

使用以下命令配置目标账号信息,注意提示信息。由于附加了ec2角色,可以env_auth值为2直接获取凭证。aksk为空

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
[root@demo ec2-user]# rclone config 
Current remotes:

Name Type
==== ====
source s3

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> n

Enter name for new remote.
name> destination

Option Storage.
Type of storage to configure.
Choose a number from below, or type in your own value.
1 / 1Fichier
\ (fichier)
2 / Akamai NetStorage
\ (netstorage)
3 / Alias for an existing remote
\ (alias)
4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, ChinaMobile, Cloudflare, DigitalOcean, Dreamhost, GCS, HuaweiOBS, IBMCOS, IDrive, IONOS, LyveCloud, Leviia, Liara, Linode, Magalu, Minio, Netease, Petabox, RackCorp, Rclone, Scaleway, SeaweedFS, StackPath, Storj, Synology, TencentCOS, Wasabi, Qiniu and others
\ (s3)
5 / Backblaze B2
\ (b2)
6 / Better checksums for other remotes
\ (hasher)
7 / Box
\ (box)
8 / Cache a remote
\ (cache)
9 / Citrix Sharefile
\ (sharefile)
10 / Combine several remotes into one
\ (combine)
11 / Compress a remote
\ (compress)
12 / Dropbox
\ (dropbox)
13 / Encrypt/Decrypt a remote
\ (crypt)
14 / Enterprise File Fabric
\ (filefabric)
15 / FTP
\ (ftp)
16 / Google Cloud Storage (this is not Google Drive)
\ (google cloud storage)
17 / Google Drive
\ (drive)
18 / Google Photos
\ (google photos)
19 / HTTP
\ (http)
20 / Hadoop distributed file system
\ (hdfs)
21 / HiDrive
\ (hidrive)
22 / ImageKit.io
\ (imagekit)
23 / In memory object storage system.
\ (memory)
24 / Internet Archive
\ (internetarchive)
25 / Jottacloud
\ (jottacloud)
26 / Koofr, Digi Storage and other Koofr-compatible storage providers
\ (koofr)
27 / Linkbox
\ (linkbox)
28 / Local Disk
\ (local)
29 / Mail.ru Cloud
\ (mailru)
30 / Mega
\ (mega)
31 / Microsoft Azure Blob Storage
\ (azureblob)
32 / Microsoft Azure Files
\ (azurefiles)
33 / Microsoft OneDrive
\ (onedrive)
34 / OpenDrive
\ (opendrive)
35 / OpenStack Swift (Rackspace Cloud Files, Blomp Cloud Storage, Memset Memstore, OVH)
\ (swift)
36 / Oracle Cloud Infrastructure Object Storage
\ (oracleobjectstorage)
37 / Pcloud
\ (pcloud)
38 / PikPak
\ (pikpak)
39 / Proton Drive
\ (protondrive)
40 / Put.io
\ (putio)
41 / QingCloud Object Storage
\ (qingstor)
42 / Quatrix by Maytech
\ (quatrix)
43 / SMB / CIFS
\ (smb)
44 / SSH/SFTP
\ (sftp)
45 / Sia Decentralized Cloud
\ (sia)
46 / Storj Decentralized Cloud Storage
\ (storj)
47 / Sugarsync
\ (sugarsync)
48 / Transparently chunk/split large files
\ (chunker)
49 / Uloz.to
\ (ulozto)
50 / Union merges the contents of several upstream fs
\ (union)
51 / Uptobox
\ (uptobox)
52 / WebDAV
\ (webdav)
53 / Yandex Disk
\ (yandex)
54 / Zoho
\ (zoho)
55 / premiumize.me
\ (premiumizeme)
56 / seafile
\ (seafile)
Storage> s3

Option provider.
Choose your S3 provider.
Choose a number from below, or type in your own value.
Press Enter to leave empty.
1 / Amazon Web Services (AWS) S3
\ (AWS)
2 / Alibaba Cloud Object Storage System (OSS) formerly Aliyun
\ (Alibaba)
3 / Arvan Cloud Object Storage (AOS)
\ (ArvanCloud)
4 / Ceph Object Storage
\ (Ceph)
5 / China Mobile Ecloud Elastic Object Storage (EOS)
\ (ChinaMobile)
6 / Cloudflare R2 Storage
\ (Cloudflare)
7 / DigitalOcean Spaces
\ (DigitalOcean)
8 / Dreamhost DreamObjects
\ (Dreamhost)
9 / Google Cloud Storage
\ (GCS)
10 / Huawei Object Storage Service
\ (HuaweiOBS)
11 / IBM COS S3
\ (IBMCOS)
12 / IDrive e2
\ (IDrive)
13 / IONOS Cloud
\ (IONOS)
14 / Seagate Lyve Cloud
\ (LyveCloud)
15 / Leviia Object Storage
\ (Leviia)
16 / Liara Object Storage
\ (Liara)
17 / Linode Object Storage
\ (Linode)
18 / Magalu Object Storage
\ (Magalu)
19 / Minio Object Storage
\ (Minio)
20 / Netease Object Storage (NOS)
\ (Netease)
21 / Petabox Object Storage
\ (Petabox)
22 / RackCorp Object Storage
\ (RackCorp)
23 / Rclone S3 Server
\ (Rclone)
24 / Scaleway Object Storage
\ (Scaleway)
25 / SeaweedFS S3
\ (SeaweedFS)
26 / StackPath Object Storage
\ (StackPath)
27 / Storj (S3 Compatible Gateway)
\ (Storj)
28 / Synology C2 Object Storage
\ (Synology)
29 / Tencent Cloud Object Storage (COS)
\ (TencentCOS)
30 / Wasabi Object Storage
\ (Wasabi)
31 / Qiniu Object Storage (Kodo)
\ (Qiniu)
32 / Any other S3 compatible provider
\ (Other)
provider> 1

Option env_auth.
Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
Only applies if access_key_id and secret_access_key is blank.
Choose a number from below, or type in your own boolean value (true or false).
Press Enter for the default (false).
1 / Enter AWS credentials in the next step.
\ (false)
2 / Get AWS credentials from the environment (env vars or IAM).
\ (true)
env_auth> 2

Option access_key_id.
AWS Access Key ID.
Leave blank for anonymous access or runtime credentials.
Enter a value. Press Enter to leave empty.
access_key_id>

Option secret_access_key.
AWS Secret Access Key (password).
Leave blank for anonymous access or runtime credentials.
Enter a value. Press Enter to leave empty.
secret_access_key>

Option region.
Region to connect to.
Choose a number from below, or type in your own value.
Press Enter to leave empty.
/ The default endpoint - a good choice if you are unsure.
1 | US Region, Northern Virginia, or Pacific Northwest.
| Leave location constraint empty.
\ (us-east-1)
/ US East (Ohio) Region.
2 | Needs location constraint us-east-2.
\ (us-east-2)
/ US West (Northern California) Region.
3 | Needs location constraint us-west-1.
\ (us-west-1)
/ US West (Oregon) Region.
4 | Needs location constraint us-west-2.
\ (us-west-2)
/ Canada (Central) Region.
5 | Needs location constraint ca-central-1.
\ (ca-central-1)
/ EU (Ireland) Region.
6 | Needs location constraint EU or eu-west-1.
\ (eu-west-1)
/ EU (London) Region.
7 | Needs location constraint eu-west-2.
\ (eu-west-2)
/ EU (Paris) Region.
8 | Needs location constraint eu-west-3.
\ (eu-west-3)
/ EU (Stockholm) Region.
9 | Needs location constraint eu-north-1.
\ (eu-north-1)
/ EU (Milan) Region.
10 | Needs location constraint eu-south-1.
\ (eu-south-1)
/ EU (Frankfurt) Region.
11 | Needs location constraint eu-central-1.
\ (eu-central-1)
/ Asia Pacific (Singapore) Region.
12 | Needs location constraint ap-southeast-1.
\ (ap-southeast-1)
/ Asia Pacific (Sydney) Region.
13 | Needs location constraint ap-southeast-2.
\ (ap-southeast-2)
/ Asia Pacific (Tokyo) Region.
14 | Needs location constraint ap-northeast-1.
\ (ap-northeast-1)
/ Asia Pacific (Seoul).
15 | Needs location constraint ap-northeast-2.
\ (ap-northeast-2)
/ Asia Pacific (Osaka-Local).
16 | Needs location constraint ap-northeast-3.
\ (ap-northeast-3)
/ Asia Pacific (Mumbai).
17 | Needs location constraint ap-south-1.
\ (ap-south-1)
/ Asia Pacific (Hong Kong) Region.
18 | Needs location constraint ap-east-1.
\ (ap-east-1)
/ South America (Sao Paulo) Region.
19 | Needs location constraint sa-east-1.
\ (sa-east-1)
/ Israel (Tel Aviv) Region.
20 | Needs location constraint il-central-1.
\ (il-central-1)
/ Middle East (Bahrain) Region.
21 | Needs location constraint me-south-1.
\ (me-south-1)
/ Africa (Cape Town) Region.
22 | Needs location constraint af-south-1.
\ (af-south-1)
/ China (Beijing) Region.
23 | Needs location constraint cn-north-1.
\ (cn-north-1)
/ China (Ningxia) Region.
24 | Needs location constraint cn-northwest-1.
\ (cn-northwest-1)
/ AWS GovCloud (US-East) Region.
25 | Needs location constraint us-gov-east-1.
\ (us-gov-east-1)
/ AWS GovCloud (US) Region.
26 | Needs location constraint us-gov-west-1.
\ (us-gov-west-1)
region> 1

Option endpoint.
Endpoint for S3 API.
Leave blank if using AWS to use the default endpoint for the region.
Enter a value. Press Enter to leave empty.
endpoint>

Option location_constraint.
Location constraint - must be set to match the Region.
Used when creating buckets only.
Choose a number from below, or type in your own value.
Press Enter to leave empty.
1 / Empty for US Region, Northern Virginia, or Pacific Northwest
\ ()
2 / US East (Ohio) Region
\ (us-east-2)
3 / US West (Northern California) Region
\ (us-west-1)
4 / US West (Oregon) Region
\ (us-west-2)
5 / Canada (Central) Region
\ (ca-central-1)
6 / EU (Ireland) Region
\ (eu-west-1)
7 / EU (London) Region
\ (eu-west-2)
8 / EU (Paris) Region
\ (eu-west-3)
9 / EU (Stockholm) Region
\ (eu-north-1)
10 / EU (Milan) Region
\ (eu-south-1)
11 / EU Region
\ (EU)
12 / Asia Pacific (Singapore) Region
\ (ap-southeast-1)
13 / Asia Pacific (Sydney) Region
\ (ap-southeast-2)
14 / Asia Pacific (Tokyo) Region
\ (ap-northeast-1)
15 / Asia Pacific (Seoul) Region
\ (ap-northeast-2)
16 / Asia Pacific (Osaka-Local) Region
\ (ap-northeast-3)
17 / Asia Pacific (Mumbai) Region
\ (ap-south-1)
18 / Asia Pacific (Hong Kong) Region
\ (ap-east-1)
19 / South America (Sao Paulo) Region
\ (sa-east-1)
20 / Israel (Tel Aviv) Region
\ (il-central-1)
21 / Middle East (Bahrain) Region
\ (me-south-1)
22 / Africa (Cape Town) Region
\ (af-south-1)
23 / China (Beijing) Region
\ (cn-north-1)
24 / China (Ningxia) Region
\ (cn-northwest-1)
25 / AWS GovCloud (US-East) Region
\ (us-gov-east-1)
26 / AWS GovCloud (US) Region
\ (us-gov-west-1)
location_constraint> 1

Option acl.
Canned ACL used when creating buckets and storing or copying objects.
This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.
For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
Note that this ACL is applied when server-side copying objects as S3
doesn't copy the ACL from the source but rather writes a fresh one.
If the acl is an empty string then no X-Amz-Acl: header is added and
the default (private) will be used.
Choose a number from below, or type in your own value.
Press Enter to leave empty.
/ Owner gets FULL_CONTROL.
1 | No one else has access rights (default).
\ (private)
/ Owner gets FULL_CONTROL.
2 | The AllUsers group gets READ access.
\ (public-read)
/ Owner gets FULL_CONTROL.
3 | The AllUsers group gets READ and WRITE access.
| Granting this on a bucket is generally not recommended.
\ (public-read-write)
/ Owner gets FULL_CONTROL.
4 | The AuthenticatedUsers group gets READ access.
\ (authenticated-read)
/ Object owner gets FULL_CONTROL.
5 | Bucket owner gets READ access.
| If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.
\ (bucket-owner-read)
/ Both the object owner and the bucket owner get FULL_CONTROL over the object.
6 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.
\ (bucket-owner-full-control)
acl> 1

Option server_side_encryption.
The server-side encryption algorithm used when storing this object in S3.
Choose a number from below, or type in your own value.
Press Enter to leave empty.
1 / None
\ ()
2 / AES256
\ (AES256)
3 / aws:kms
\ (aws:kms)
server_side_encryption> 1

Option sse_kms_key_id.
If using KMS ID you must provide the ARN of Key.
Choose a number from below, or type in your own value.
Press Enter to leave empty.
1 / None
\ ()
2 / arn:aws:kms:*
\ (arn:aws:kms:us-east-1:*)
sse_kms_key_id> 1

Option storage_class.
The storage class to use when storing new objects in S3.
Choose a number from below, or type in your own value.
Press Enter to leave empty.
1 / Default
\ ()
2 / Standard storage class
\ (STANDARD)
3 / Reduced redundancy storage class
\ (REDUCED_REDUNDANCY)
4 / Standard Infrequent Access storage class
\ (STANDARD_IA)
5 / One Zone Infrequent Access storage class
\ (ONEZONE_IA)
6 / Glacier storage class
\ (GLACIER)
7 / Glacier Deep Archive storage class
\ (DEEP_ARCHIVE)
8 / Intelligent-Tiering storage class
\ (INTELLIGENT_TIERING)
9 / Glacier Instant Retrieval storage class
\ (GLACIER_IR)
storage_class> 1

Edit advanced config?
y) Yes
n) No (default)
y/n> n

Configuration complete.
Options:
- type: s3
- provider: AWS
- env_auth: true
- region: us-east-1
- acl: private
Keep this "destination" remote?
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y

Current remotes:

Name Type
==== ====
destination s3
source s3

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> q

4.迁移数据

1.查看源桶和目标桶内的信息

1
2
3
4
5
6
7
8
9
10
[root@demo ec2-user]# rclone lsd source:source-bucket-132
0 2000-01-01 00:00:00 -1 test1
0 2000-01-01 00:00:00 -1 test2
[root@demo ec2-user]# rclone ls source:source-bucket-132
413276 1.png
214423 2.png
581709 3.png
1913064 test1/Everything-1.4.1.1026.x64-Setup.exe
688018 test2/demo.mp4
[root@demo ec2-user]# rclone ls destination:destination-bucket-132

2.执行迁移

1
2
3
4
[root@demo ec2-user]# rclone sync source:source-bucket-132 destination:destination-bucket-132 --progress
Transferred: 3.634 MiB / 3.634 MiB, 100%, 0 B/s, ETA -
Transferred: 5 / 5, 100%
Elapsed time: 0.4s

四. 确认数据迁移情况

使用rclone ls查看目标桶内的对象

1
2
3
4
5
6
[root@demo ec2-user]# rclone ls destination:destination-bucket-132
413276 1.png
214423 2.png
581709 3.png
1913064 test1/Everything-1.4.1.1026.x64-Setup.exe
688018 test2/demo.mp4

打开S3控制台,查看目标桶内的对象
4.1-showS3Detail.png