1
0
Fork
You've already forked GDrive-rsync
0
Google Shared Drive to Google Team Drive migration script
  • Python 100%
Nick Guenther 09ffe2dd1b Delete duplicates before copying
That way if the copy fails at least the target is marked out-of-date
2023年11月13日 06:34:25 -05:00
main.py Delete duplicates before copying 2023年11月13日 06:34:25 -05:00
README.md initial commit w/ readme 2023年08月31日 14:11:39 -04:00
requirements.txt Cut dependencies down to direct dependencies only. 2023年11月13日 02:48:41 -05:00

Google shared drive to Google TeamDrive via reparenting

Requires:

  • Permissions to a shared drive you want to copy from
  • A google workspace account (possibly administrative?)

Initial setup

(described at length in https://martinheinz.dev/blog/84)

You will need to create a Google Cloud Project, via cloud resource manager (https://console.cloud.google.com/cloud-resource-manager/#rationale) or cli gcloud projects create PROJECT_NAME

The only API you need to enable here is the drive API, I started with read-only to test but you will want full read-write access.

(expand on oauth, etc. later)

save oauth credentials as a json file to be callable via the script.

To run

touch token.json # this will be populated as needed by the authentication
python3 main.py -C [CREDENTIALS_FILE.json] -T token.json -f [SHARED_DRIVE] -t [TEAM_DRIVE]