Skip to content

Field-tested rclone scripts to migrate Google Drive (My Drive, Shared With Me, Shared Drives) with logs and verification.

License

Notifications You must be signed in to change notification settings

andrewchee/gdrive-migrate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gdrive-migrate

License: MIT Shell Status: Stable

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.


Install

Requires:

  • rclone ≥ 1.62

  • Two rclone remotes configured (e.g., gsrc, gdst)

    brew install rclone rclone version


Environment

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

Usage

1. Stage Source Drive

Move all root-level items into a staging folder:

bash bin/01_move_root_to_staging.sh

2. Copy My Drive

Server-side copy from staging → destination:

bash bin/02_copy_mydrive.sh

3. Copy Shared With Me

Client-side resumable copy of "Shared with me":

bash bin/03_copy_sharedwithme.sh

If interrupted, resume with:

bash bin/07_resume_sharedwithme.sh

4. Export Fallback

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

5. Monitor Progress & Logs

Tail recent logs live:

bash bin/05_tail_logs.sh

Poll destination sizes every N seconds:

bash bin/10_progress_poll.sh 120 MyDrive

6. Verify Transfers

Check sizes:

bash bin/06_size_snapshots.sh

One-way integrity check (size-only):

bash bin/09_check_mydrive.sh

7. Shared Drives

List all shared drives available:

bash bin/08_list_shared_drives.sh

Scripts

  • 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).


License

MIT


Acknowledgments

LLM: OpenAI ChatGPT-5
Contributions welcome: open an issue to discuss improvements or submit a pull request.

About

Field-tested rclone scripts to migrate Google Drive (My Drive, Shared With Me, Shared Drives) with logs and verification.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages