It seems like the Make a Copy option only works for individual files (not for folders).
When somebody shares a folder with me on Google Drive, how can I make a copy of that folder in my own Google Drive account?
It seems like the Make a Copy option only works for individual files (not for folders).
When somebody shares a folder with me on Google Drive, how can I make a copy of that folder in my own Google Drive account?
You can get all your data copy to your drive by using Google Colab.
Just follow the simple steps to get that.
from google.colab import drive
drive.mount('/gdrive')
%cd /gdrive/MyDrive/<path to the link added in step 5>
The path will end with the link name, by default the same name of the shared folder you're copying from.
pwd
to check the current path. It should start like this /gdrive/.shortcut-targets-by-id/<unique-id>/yoursharedfoldernameetc
.!cp -r 'above-copy-path/.' '/gdrive/My Drive/destinantion-path'
And there you go. It will start copying all shared folder content to your destination folder.
cp: cannot open '/gdrive/.shortcut-targets-by-id/0B7r...Smc/Name-of-shared-folder/subfolder/subfile.gsheet' for reading: Operation not supported
with gsheets and gdocs, that seems to defy any usability.
!cp -r 'above-copy-path/.' '/gdrive/My Drive/destinantion-path'
looks like a spare whitespace in 'My Drive', should be 'MyDrive' anyway, AWESOME trick
Commented
Apr 14, 2021 at 12:27
!cp
worked fine for me.
Inspired by Hamza Safdar's answer, I created an end-to-end Colab for those who are not familiar with Python and Colab at here.
In case people can not access the Colab above, I also add the code as follows:
#@title Deeply copy shared folders in Google Drive
from google.colab import drive
import os
print('Mounting Google Drive...')
drive.mount('/gdrive')
src_path = '/gdrive/MyDrive/DE A1' #@param {type: 'string'}
assert os.path.exists(src_path), f"Source '{src_path}' doesn't exist!"
target_path = '/gdrive/MyDrive/Language/German' #@param {type: 'string'}
os.makedirs(target_path, exist_ok=True)
assert os.path.exists(target_path), f"Target '{target_path}' doesn't exist!"
target_path = os.path.join(target_path, os.path.basename(src_path))
print(f'Copying from "{src_path}" to "{target_path}"...')
os.makedirs(target_path, exist_ok=True)
!cp -rf "$src_path"/* "$target_path" # also work when source is a shortcut
Sounds like you want a deep copy without any previous reference to the original folders & documents. Under these circumstances:
from google.colab import drive
drive.mount('/content/gdrive')
!cp -r '/gdrive/MyDrive/src/.' '/gdrive/MyDrive/dest'
If your Google Account supports "Drive File Stream" https://www.google.com/drive/download/ - you can access the contents of the folder simply from Windows Explorer or the Command Prompt - and copy the files just as you would do on a local drive.
Here's another way to copy a folder with an external application:
*The service is free up to 5GB of traffic per month.
I just had exactly the same issue. And I copied everything successfully via this open-source service: https://github.com/ericyd/gdrive-copy
After you finish your copy, do remember to revoke your granted permission to this app.
What was Marikamitsos and Hamza Safdar said really works! Thank you so much, but I cannot both vote and comment on your post since I am a new member. I am here just to thanks Marikamitsos and Hamza Safdar and share with the others the details of the step.
Initially, tbh, as a common person that didn't know anything about Google Colab, I am very confused. I suffered trying many times. Eventually, I yell when it becomes a success. Hopefully, I can make it easy for someone who didn't know anything about Google Colab like me.
from google.colab import drive
drive.mount('/gdrive')
Click a play button / Ctrl + Enter
Simply just open the given URL => choose the same google account that contains your destination drive => allow access => you will get the authorization code
Copy the authorization code to the column "Enter your authorization code"
Click a play button / Ctrl + Enter
%cd /gdrive/My\ Drive/Name of shared folder
You must change the "Name of shared folder" with the name of your shared folder For example: %cd /gdrive/My Drive/Mango
Click a play button / Ctrl + Enter
It should appear the shared folder's address in the bottom like this: For example: /gdrive/.shortcut-targets-by-id/blabalabla/Mango
cp -r 'shared folder address' 'the address of folder that you want'
For example: !cp -r '/gdrive/.shortcut-targets-by-id/blabalabla/Mango' '/gdrive/My Drive/Orange'
Click a play button / Ctrl + Enter
Wait until the process is done. Hupla! Your shortcut of the folder shared file already copied into the folder that you give the name.
I solved this conundrum using Rclone with the copy
command.
(Short explanation: Rclone is an open-source command line tool for managing files and folders in cloud storage — it lets you copy, move, sync, list, and whatever else you would want to do with files.)
What you'll need to do:
rclone config
. A "remote" is just a cloud storage location that you've added to rclone, so it has credentials to access it. This takes several steps — the instructions are easy to follow, but refer to the Google Drive remote docs for all the details. (NB: make sure you're setting up a Google Drive remote and not a Google Cloud Storage one!)rclone copy
to copy the contents of one directory in the remote to another directory in the same remote (if you want to copy to a different Drive or Shared Drive, you'll need to add a second remote for that). The full command will be something like:
rclone copy my-drive-remote:some/path/to/original-folder-I-dont-own my-drive-remote:some/path/to/new-folder-I-own
.Refer to the rclone copy docs for additional parameters. Defaults should be fine unless you're moving lots of files or very large files.
Some extra notes:
I was suffering from same problem then I got solution by my own,
A Google Drive migration extension is available in Chrome extensions store, you can copy the entire folder with that.
Download extension from here. https://chrome.google.com/webstore/detail/drive-migrator/nakklajdcijlkfagghhcdofbgbhddoed?hl=en
Step1 : Install extension in chrome browser.
Step2 : Open your Google drive account (primary) where all your file exists.
Step3 : Share that particular holder to your secondary Gmail account.
Step4 : Open your secondary Gmail account, select the shared folder and copy all the files with the extension.
Step5 : Now go to Primary account folder and delete.
The proper, updated answer as per today (2020-06-24) for activate the previous available now hidden functionality for saving a Shared with Me folder into your Google Drive as an active working link available at your computer or drive, is to press Shift+Z and then click on the Shared Folder (ref.).
I found somewhat a simpler solution here.
Please comment if something not works. Please like the video (it's not mine but sure it is helpful)
Make a copy of the files inside the shared folder. Drag all copies to your Google Drive folder on the left panel. Done!
If you guys have some error when using Google Colab methods like this:
"cp: error reading '...' Input/output error"
try this command:
!sudo cp -v -r '/content/drive/.shortcut-targets-by-id/<some-id>/<name-of-folder>/.' '/content/drive/MyDrive/<name-of-destination-folder>'
just replace !cp with !sudo cp -v -r. It works for me.
Add to My Drive
doesn't really work as I was expecting. It only adds the link, but not the content itself.
Commented
Sep 6, 2018 at 17:23
As of January 2021, this functionality is built in:
First share the folder and give the recipient all permission:
Now close all dialogues and return to the "start view" of Google Drive. Again right click -> Share on the folder you shared in the previous step. Select the recipient and click the pop-up menu. Now, there is an option "Make owner"
By selecting this, the folder is moved from the recipients Shared with me to the "root" of his/her drive. The recipient can now remove the original owner through the same share menu to make the folder his/her own folder.
I find with "Google Drive" app on Android, there's an option "Move" for shared folder. And with this option, it is able to copy the folder to your own drive. But I don't understand why the option is not available on web and iOS...