Zum Inhalt springen

Daten mit rclone migrieren

Bevor Sie beginnen, müssen die folgenden Dinge bereitstehen:

Sie können die Quelle und das Ziel einfach über die Konfigurationsdatei ~/.config/rclone/rclone.conf einrichten. Fügen Sie dieser Konfigurationsdatei einfach Quelle / Ziel einschließlich Access-Key und Secret-Key hinzu und speichern Sie diese.

Beispiel:

cat ~/.config/rclone/rclone.conf [source] type = s3 provider = Other access_key_id = ***************** secret_access_key = ***************** endpoint = [https://platform.cloud.schwarz:8080](https://platform.cloud.schwarz:8080) acl = private [destination] type = s3 provider = Other access_key_id = ***************** secret_access_key = ***************** endpoint = [https://object.storage.eu01.onstackit.cloud](https://object.storage.eu01.onstackit.cloud) acl = private

Anschließend können Sie mit dem Befehl rclone config überprüfen, ob sowohl Quelle als auch Ziel korrekt hinzugefügt wurden.

Wir empfehlen außerdem, Ihre Konfigurationsdatei zu verschlüsseln, um die Access-Keys und Secret-Keys in Ihrer Konfiguration zu schützen, indem Sie beim Befehl rclone config die Option “Set configuration password” wählen.

Beispiel:

rclone config 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> s Your configuration is not encrypted. If you add a password, you will protect your login information to cloud services. a) Add Password q) Quit to main menu a/q> a Enter NEW configuration password: password: Confirm NEW configuration password: password: Password set Your configuration is encrypted.

Sie können die Daten nun von der Quelle zum Ziel migrieren, indem Sie

Terminal-Fenster
clone copy source:/$BUCKET_NAME destination:/$BUCKET_NAME```

verwenden.

In unserem Beispiel haben wir zudem einige nützliche Parameter für Statistiken, Logging und Multi-Part-Uploads hinzugefügt.

rclone copy source:/directory1 destination:/directory1 --s3-upload-cutoff 0 --progress --log-file /tmp/rclone.log Enter configuration password: Transferred: 300 / 300 Bytes, 100%, 218 Bytes/s, ETA 0s Errors: 0 Checks: 0 / 0, - Transferred: 50 / 50, 100% Elapsed time: 1.3s

Prüfen Sie nach Abschluss die Statistiken und die Log-Datei auf etwaige Fehler.

  • Eine vollständige Liste der rclone-Flags finden Sie in der offiziellen Dokumentation