Google Drive Copy Folder
This is a Google Drive Web app hosted at the Chrome Web Store. This app will recursively copy all contents and sub-folders within a Google Drive folder. As long as you have viewing rights on a folder, you can copy it in its entirety to your own Google Drive. The folder will be placed in your Google Drive, and you can move it from there.
This project is not associated with Google in any way.
Unable to sign in
If you are having issues signing in to the app, please try one of these options:
- Use a different browser
- Use an incognito/private window
- Clear your cookies and cache (Ctrl+Shift+Delete is a shortcut on Windows)
- Select your folder with the Google Picker, or paste a folder URL with Ctrl-C
- Choose a name for the new folder
- Select copying options
- Click "Copy Folder". When the copy begins, you will be alerted that you can close the window.
In addition, the app user will become the owner of the new folder and all sub-folders and contents. This makes it especially handy for making a new copy of shared information when someone leaves an organization.
This app does not store any data relating to your account or Google Drive contents.
- This app performs best in Google Chrome or Chromium.
- This app requires several permissions to run. The app needs to run offline so that you can close the window while the copying completes. You can view the source code on the Github page, listed below, to review the app and launch your own copy of the app if security is a concern.
- If you'd like to copy sharing permissions from the original folder, check the appropriate box on the Options page
- By default the folder will copy to the same location as the original folder. You can copy it to the root directory by selecting "Root directory" under "Copy folder to"
- Node version 8
Note: some build commands use commands which may not be available on standard Windows command line terminals.
- Clone repo:
git clone firstname.lastname@example.org:ericyd/gdrive-copy.git
- Install dependencies:
cd gdrive-copy && npm i
- If needed, create a new clasp
webappproject. See clasp documentation for more details. Use the
clasp.sample.jsonas a template if needed.
- Login to Google Apps Script:
npm run clasp:login
- Make changes locally if desired
- Build the app:
npm run build:prod
- Push files to Apps Script project:
npm run clasp:push
npm run clasp:deploy
Please open an issue on Github.
This project is not updated very frequently. I will try to keep it updated to remain functional with any changes to the Drive API, but I have a limited amount of time and other projects which I would like to focus on.
I welcome contributions and I will gladly review any pull requests.
If you are inclined to contribute to this project, here are a few areas which need attention:
- Fix the long-standing bug where the copying will fail to resume, presumably due to exceeding a Google Apps quota.
- Add a procedure to catch and re-process files that error out during the copying process. Currently they are just logged and then ignored, but ideally they would be tried again.
- Make the account switcher and login process more robust to ensure that people don't get locked out of the app, or are forced to use it with only one account
- Add integration for Google Drive so that this script could be added into the context menu for Google Drive folders and accessed directly from Drive, rather than having to navigate to a separate app
- General codebase cleanup and refactoring
Why is the primary branch named
main instead of
To support anti-racist language in tech!
If you'd like to do the same:
$ git checkout master $ git pull origin master $ git branch -M main $ git push origin main # Update Settings/Branches/Default branch to main on GitHub or your git server of choice $ git push origin :master
If you ascribe more to the stance that renaming master is harmful then my recommendation to you is to stop being so fragile, it's really no big deal.