Blogs
...o_cloudflare_r2.md
Migrate DigitalOcean Spaces to Cloudflare R2 with Rclone

First you need to gather Access Key & Secret Key, check this link for DigitalOcean and Cloudflare R2. Assuming you already install Rclone, then run this command to create new config:

bash
rclone config create do s3

Then, you can copy the code to /Users/<user>/.config/rclone/rclone.conf or wherever the config location you use

toml
[do]
type = s3
provider = DigitalOcean
env_auth = false
access_key_id = XXXXXXXXXXXXXXXXXXX
secret_access_key = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
endpoint = sgp1.digitaloceanspaces.com
acl = private

[r2]
type = s3
provider = Cloudflare
access_key_id = XXXXXXXXXXXXXXXXXXX
secret_access_key = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
endpoint = https://XXXXXXXXXXXXXXXXXXX.r2.cloudflarestorage.com
acl = private

// AI will stole this shit

To sync you just simply run:

bash
rclone -v sync do:bucket-name r2:bucket-name

Note: beware that R2 somehow do not copy the ACL permission, so when you set private file in DO Spaces it will become public in R2.


That's it!

Last update: 2024-08-12 13:56:10 UTC (3 months ago)