Field-tested rclone scripts for migrating Google Drive data between accounts.
Tools to stage, copy, verify, and export Google Drive content (My Drive, “Shared with me”, and Shared Drives) with resumable, idempotent commands and detailed logs.
Requires:
-
rclone ≥ 1.62
-
Two rclone remotes configured (e.g.,
gsrc
,gdst
)brew install rclone rclone version
All scripts load variables from .env
in the project root.
An example .env.example
is included — copy and edit it.
SRC_REMOTE=gsrc
DST_REMOTE=gdst
STAGE=Drive_Migration_2025_08_18
DST_ROOT=__FULL_BACKUP_2025_08_18
TRANSFERS=4
CHECKERS=8
TPSLIMIT=4
RETRIES=999
RETRY_SLEEP=10s
PACER_MIN_SLEEP=500ms
Copy the template and edit:
cp .env.example .env
Move all root-level items into a staging folder:
bash bin/01_move_root_to_staging.sh
Server-side copy from staging → destination:
bash bin/02_copy_mydrive.sh
Client-side resumable copy of "Shared with me":
bash bin/03_copy_sharedwithme.sh
If interrupted, resume with:
bash bin/07_resume_sharedwithme.sh
Export blocked Google Docs/Sheets/Slides to Office/PDF formats:
bash bin/04_export_fallback.sh
Optionally pass a file list:
bash bin/04_export_fallback.sh logs/failed_items.txt
Tail recent logs live:
bash bin/05_tail_logs.sh
Poll destination sizes every N seconds:
bash bin/10_progress_poll.sh 120 MyDrive
Check sizes:
bash bin/06_size_snapshots.sh
One-way integrity check (size-only):
bash bin/09_check_mydrive.sh
List all shared drives available:
bash bin/08_list_shared_drives.sh
bin/01_move_root_to_staging.sh
— sweep source root into staging folder (resume-safe).bin/02_copy_mydrive.sh
— server-side copy staging → Destination.bin/03_copy_sharedwithme.sh
— copy "Shared with me" into Destination.bin/04_export_fallback.sh
— export Google-native files.bin/05_tail_logs.sh
— live tail of logs.bin/06_size_snapshots.sh
— JSON size reports for verification.bin/07_resume_sharedwithme.sh
— resume "Shared with me" copy.bin/08_list_shared_drives.sh
— list shared drives.bin/09_check_mydrive.sh
— one-way integrity check.bin/10_progress_poll.sh
— poll destination sizes periodically.lib/common.sh
— shared config and environment.
Logs are written to logs/
(git-ignored).
LLM: OpenAI ChatGPT-5
Contributions welcome: open an issue to discuss improvements or submit a pull request.