Migrate data to Object Storage using rclone
Last updated on
By the end of this tutorial, rclone is configured with a source and a destination storage endpoint and data is migrated between them. This tutorial uses STACKIT Object Storage as the migration destination.
Prerequisites
Section titled “Prerequisites”- rclone installed on your system.
- Object Storage access credentials for the destination endpoint. For instructions, read Create Object Storage credentials.
- Access credentials for the source endpoint.
Configure source and destination
Section titled “Configure source and destination”rclone uses a configuration file at ~/.config/rclone/rclone.conf to store remote definitions. Open this file in a text editor and add entries for both the source and destination, replacing the placeholder values with your actual credentials:
[source]type = s3provider = Otheraccess_key_id = YOUR_SOURCE_ACCESS_KEYsecret_access_key = YOUR_SOURCE_SECRET_KEYendpoint = https://platform.cloud.schwarz:8080acl = private
[destination]type = s3provider = Otheraccess_key_id = YOUR_DESTINATION_ACCESS_KEYsecret_access_key = YOUR_DESTINATION_SECRET_KEYendpoint = https://object.storage.eu01.onstackit.cloudacl = privateVerify that both remotes are registered correctly:
rclone configThe output lists all configured remotes:
Current remotes:
Name Type==== ====destination s3source s3
e) Edit existing remoten) New remoted) Delete remoter) Rename remotec) Copy remotes) Set configuration passwordq) Quit confige/n/d/r/c/s/q>Migrate the data
Section titled “Migrate the data”With both remotes configured, copy the data from the source bucket to the destination bucket. Replace BUCKET_NAME with your actual bucket name:
rclone copy source:/BUCKET_NAME destination:/BUCKET_NAME \ --s3-upload-cutoff 0 \ --progress \ --log-file /tmp/rclone.logrclone reports progress during the transfer and writes detailed output to /tmp/rclone.log. When the copy finishes, the summary shows the number of bytes and files transferred:
Transferred: 300 / 300 Bytes, 100%, 218 Bytes/s, ETA 0sErrors: 0Checks: 0 / 0, -Transferred: 50 / 50, 100%Elapsed time: 1.3sAfter the transfer completes, review the log file for any errors:
cat /tmp/rclone.logNext steps
Section titled “Next steps”For a full reference of all rclone flags and options, see the official rclone documentation.