从iCloud迁移照片到Google Drive
缘由&要求
iPhone的屏幕碎裂,又想着去Apple化,加之在浏览Google Photos时候的感触颇深,于是就有了这样的操作。
当然,需要一台位于境外的VPS,从iCloud上拉资源,再上传到Google Drive。
从iCloud上下载
由于Apple没有开放iCloud的API,于是关于iCloud下载的第三方程序少之又少。于是我找到了这个icloudpd
1 | #以Ubuntu/Debian系统为例 |
使用icloud photos
(注意,photos为你要保存照片的目录,可自定义为其他。)
接着会要求输入iCloud账号密码,验证完成后就会开始下载,我用了51分20秒把2324张照片下载了下来。但是为什么速度不理想,原因很大程度上是因为苹果的iCloud服务器由云上贵州接管,服务器在国内,晚上又是高峰时段,速度。。。嗯,苹果💊。
上传到Google Drive
Google作为行业巨头,全力推行开源事业,有关Drive的有关程序网上比比皆是,我这里介绍我正在使用的一个名为rclone的管理程序。
rclone的安装
下载rclone
1 | #按照官方Docs操作就好。 |
复制赋权
1 | cp rclone /usr/bin/ |
安装帮助页面
1 | mkdir -p local man/man1 |
配置
键入rclone config即可进入配置页面。
这里是配置实例,基本上有些英语基础就没问题。也可以参考https://rclone.org/drive/ 给出的实例,或者https://www.chenweiliang.com/cwl-694.html 的例子。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
120root@Raincorn:/rclone# rclone config
2019/01/30 21:25:58 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(创建新的Drive类型)
name> Google(自定义配置的名称)
Type of storage to configure.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
1 / A stackable unification remote, which can appear to merge the contents of several remotes
\ "union"
2 / Alias for a existing remote
\ "alias"
3 / Amazon Drive
\ "amazon cloud drive"
4 / Amazon S3 Compliant Storage Providers (AWS, Ceph, Dreamhost, IBM COS, Minio)
\ "s3"
5 / Backblaze B2
\ "b2"
6 / Box
\ "box"
7 / Cache a remote
\ "cache"
8 / Dropbox
\ "dropbox"
9 / Encrypt/Decrypt a remote
\ "crypt"
10 / FTP Connection
\ "ftp"
11 / Google Cloud Storage (this is not Google Drive)
\ "google cloud storage"
12 / Google Drive
\ "drive"
13 / Hubic
\ "hubic"
14 / JottaCloud
\ "jottacloud"
Storage> 12(选择类型,会随着版本变动而有所变化。)
** See help for drive backend at: https://rclone.org/drive/ **
Google Application Client Id
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_id>
Google Application Client Secret
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_secret>
Scope that rclone should use when requesting access from drive.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
1 / Full access all files, excluding Application Data Folder.
\ "drive"
2 / Read-only access to file metadata and file contents.
\ "drive.readonly"
/ Access to files created by rclone only.
3 | These are visible in the drive website.
| File authorization is revoked when the user deauthorizes the app.
\ "drive.file"
/ Allows read and write access to the Application Data folder.
4 | This is not visible in the drive website.
\ "drive.appfolder"
/ Allows read-only access to file metadata but
5 | does not allow any access to read or download file content.
\ "drive.metadata.readonly"
scope> 1(即允许rclone获得你全部的Drive访问权限。)
ID of the root folder
Leave blank normally.
Fill in to access "Computers" folders. (see docs).
Enter a string value. Press Enter for the default ("").
root_folder_id>
Service Account Credentials JSON file path
Leave blank normally.
Needed only if you want use SA instead of interactive login.
Enter a string value. Press Enter for the default ("").
service_account_file>
Edit advanced config? (y/n)
y) Yes
n) No
y/n> n(不进行高级配置。)
Remote config
Use auto config?
* Say Y if not sure
* Say N if you are working on a remote or headless machine or Y didn't work
y) Yes
n) No
y/n> n
If your browser doesn't open automatically go to the following link: https://accounts.google.com/(你需要登陆的链接。)
Enter verification code> 4/4gBaYe2_(你在网页中获得erification code)
Configure this as a team drive?
y) Yes
n) No
y/n> n
--------------------
[Google]
type = drive
scope = drive
token = {"access_token":"ya29.GluhBkLo5l7zLGZFmeHEbBSWFxJD8HaiAqpDLmD7BPPFUGcpXrgnnd8pWoahZJvgyv9Qk5yc7TxRLRmxKt31N8mmjP4bbvr2sSb_E8ZbpRNetFtglc2SrjMRFW6z","token_type":"Bearer","refresh_token":"1/jmLzUeXGBUqMVHV_k4x8F6UhPXkbMW-U-zJpnGnnv6I","expiry":"2019-01-30T22:28:52.644486809+08:00"}
--------------------
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d> y
Current remotes:
Name Type
==== ====
Google drive
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
开始上传Google Drive
(本地文件夹以origin,Drive文件夹以backup为例)
在web端新建一个名为backup的文件夹,新建完成后使用1
2
3
4
5root@Raincorn:/rclone# rclone lsd Google:
-1 2019-01-30 21:32:54 -1 backup
#这里的“Google”即为你所创建的配置名称,backup即为你刚刚新建的那个用来备份的文件夹。
root@Raincorn:/rclone# rclone copy /root/origin Google:backup
#/root/origin为源文件夹,Google:backup为配置名称+远程文件夹。
QWQ,(我不会告诉你第二步花了我5个小时,也许是主机商的锅?
本文标题:从iCloud迁移照片到Google Drive
文章作者:Raincorn
发布时间:2019-02-03
最后更新:2020-07-28
原始链接:https://blog.raincorn.top/2019/02/03/From_iCloud_to_Google_Drive/
版权声明:本文采用知识共享署名-非商业性使用 4.0 国际许可协议进行许可