https://github.com/eboukamza/google-drive-migration-tool
Google Drive Migration Tool
https://github.com/eboukamza/google-drive-migration-tool
cli google-drive google-drive-api-nodejs google-workspace migration tool
Last synced: 2 months ago
JSON representation
Google Drive Migration Tool
- Host: GitHub
- URL: https://github.com/eboukamza/google-drive-migration-tool
- Owner: eboukamza
- License: apache-2.0
- Created: 2023-02-08T13:50:19.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-02-08T13:50:59.000Z (over 2 years ago)
- Last Synced: 2023-08-06T22:10:45.606Z (almost 2 years ago)
- Topics: cli, google-drive, google-drive-api-nodejs, google-workspace, migration, tool
- Language: TypeScript
- Homepage:
- Size: 83 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Google Drive Migration Tool
Transfer the ownership between two different domains by coping folder hierarchy and files.
This tool is EXPERIMENTAL and is NOT an official tool. This tool is released WITHOUT ANY warranty of any kind.
| Source | Dest |
| ---------------------- | ---------------------- |
| Google Workspace | Google Account (gmail) |
| Google Account (gmail) | Google Workspace |
| Google Workspace A | Google Workspace B |## Prerequisites
node +16
Follow Develop on Google Workspace guide to set up an OAuth consent screen and OAuth Credentials
https://developers.google.com/workspace/guides/get-started?hl=en_US
1. Create a Google Cloud project
2. Enable Drive API
3. Configure OAuth consent screen
4. Create OAuth credentials5. Create an .env file from .env_template (`cp .env_template .env`) and set up env vars.
6. Build the project `yarn && yarn build`## Instructions
Trash should be empty
1. Share (with role Editor) files and folders to be transferred with the destination account.
2. Create 'migrationSource' folder in the destination Drive account.
3. Put inside all files and folders to be migrated
4. Run the script `./bin/google-drive-migration-tool migrate`First time the script opens the browser to request the permissions to read and write files in Drive.
Credentials are stored in a file named token.json. If you want to change the user you need to delete this file.Copied files are located at 'migrationDest' folder in the root (MyDrive)
## Resources
Google Auth reference:
https://github.com/googleapis/google-auth-library-nodejs#oauth2
https://cloud.google.com/nodejs/docs/reference/google-auth-library/latestInspired on https://www.npmjs.com/package/@google-cloud/local-auth to retrieve the auth token.
https://developers.google.com/drive/api/quickstart/nodejs?hl=en_US#authorize_credentials_for_a_desktop_applicationGoogle Drive
Based on https://developers.google.com/drive/api/quickstart/nodejs?hl=en_US
Api reference: https://developers.google.com/drive/api/v3/reference