65

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?

0

18 Answers 18

87

You can get all your data copy to your drive by using Google Colab.
Just follow the simple steps to get that.

  1. On your drive, create a shortcut to the shared folder
  2. Open https://colab.research.google.com/
  3. Create new Notebook
  4. Mount your google drive by doing the following:
from google.colab import drive
drive.mount('/gdrive')
  1. First right click on the shared folder, click 'Add Shortcut to Drive' to create a symlink of the folder to your drive. You can delete this afterwards.
  2. Type:
%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.

  1. Type pwd to check the current path. It should start like this /gdrive/.shortcut-targets-by-id/<unique-id>/yoursharedfoldernameetc.
    Copy this path.
  2. Run this:
!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.

16
  • 8
    from the very beginning of copying I get a lot of 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.
    – sukhmel
    Commented Jun 11, 2020 at 15:56
  • 1
    @d-b not easily because mounting drive in Colab annoyingly requires user interaction.
    – daknowles
    Commented Feb 23, 2021 at 13:58
  • 4
    !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
  • 1
    Looks like the shortcut is no longer necessary, directly referencing the source folder in the !cp worked fine for me.
    – Leor
    Commented Jul 13, 2021 at 19:30
  • 1
    @sukhmel yeah, it doesn't work for Google files (sheets, docs, presentation etc.) Commented May 18, 2023 at 16:39
13

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.

Screenshot: enter image description 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
1
  • Thanks! All I did was open the link, copy the collab to my drive, edit the src_path and target_path variables, and press run. Magical! It doesn't copy google docs files, unfortunately.
    – hajamie
    Commented Sep 15, 2023 at 10:47
9

Sounds like you want a deep copy without any previous reference to the original folders & documents. Under these circumstances:

  1. Download the folder.
    Download
  2. Extract content
  3. Upload to your drive.
7
  • 12
    No... that's very expensive, especially if you are living on mobile internet or a slow connection... :-( Commented Nov 6, 2018 at 10:41
  • 1
    True, but it will work. If you have a better solution, write it up. Working on a Cloud Drive already has certain expectations regarding connectivity and bandwidth.
    – StampedeXV
    Commented Nov 6, 2018 at 13:42
  • Looks like it's the only workable solution. I am curious why Google didn't create something more straightforward way of doing that and we have to invent a workaround. You may need that for 2 simple reason: 1. To be sure that this folder will be safe on your drive even if the owner deletes it. 2. You may want to rename the content of the folder. Commented Mar 17, 2019 at 13:16
  • 1
    Beware of the native Google documents (i.e. Sheet, Drawings, Docs, Forms, etc.) for which no content is "accessible" to the users out of the Google editors (e.g. website or native mobile apps). Drive will have to convert them in "actual" formats which is quite OK for Office-like docs (e.g. Sheet->Excel, Doc->Word, etc.) but not great for drawings which are flatened into JPG files (I'd have expected and preferred SVG format). Forms are also turned into HTML forms along with their data in a CSV file.
    – Attila
    Commented May 5, 2020 at 10:58
  • 1
    Take note of this: If you download the folder containing Google Docs, Slides or Sheets, they will be converted to docx, pptx & xlsx. Some formatting changed when the file format changes. And if you upload these docx, pptx & xlsx back, the uploaded file will not be exactly the same as the original anymore. Commented Jan 1, 2022 at 19:06
8
  1. Create a new Google Colaboratory Notebook
  2. Mount your Google Drive:-
    from google.colab import drive
    drive.mount('/content/gdrive')
    
  3. Copy via shell:-
    !cp -r '/gdrive/MyDrive/src/.' '/gdrive/MyDrive/dest'
    
2

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.

2

Here's another way to copy a folder with an external application:

  1. Add the folder to "My Drive".
  2. Open your account with a website: www.multcloud.com
  3. Find the folder - and create a copy into the account.

*The service is free up to 5GB of traffic per month.

3
  • 3
    This solution has the advantage over some of the others that it will preserve the format of Google Docs and Sheets on your Google Drive. For example, if you download and then re-upload a Google Doc, it will be converted to a docx file. Sometimes the layout will have changed due to this conversion.
    – Moot
    Commented Sep 23, 2019 at 7:21
  • Good solution. The only thing, however, is that the documents' update history is lost.
    – cawecoy
    Commented Jul 3, 2020 at 0:51
  • 1
    Worth noting that solutions like this also allow the provider (www.multcloud.com in this case) to read all your files. Whether they keep a copy, watch transfers, log, or keep logs is up to them.
    – joshfindit
    Commented Mar 6, 2021 at 16:19
1

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.

1

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.


  1. Create a shortcut of the shared by right-clicking the folder => click "Add shortcut to Drive"

  1. Open the Google Colab website: https://colab.research.google.com/ => click Create a new Notebook

  1. Insert your drive by typing in that blank space :

from google.colab import drive

drive.mount('/gdrive')

Click a play button / Ctrl + Enter


  1. Then, they will ask "Enter your authorization code"

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


  1. Know the shared folder's address by typing in that blank space :

%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


  1. The final step, create a new folder using the shared folder address and the address of folder that you want, by typing :

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.

1

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:

  1. Install Rclone
  2. Set up a Google Drive remote for your My Drive (or a Shared Drive if you're using G Suite) using 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!)
  3. Once you've added the remote, you can use 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.
  4. Confirm in the Drive web UI that the new folder contains everything, and that you're the owner of the newly-created files.

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:

  • This does copy Google docs, sheets, etc in their original format, although it may go through a conversion from gdoc > docx/xlsx/etc > back to gdoc. I haven't noticed any problems.
  • File permissions are inherited from the new folder. If the originals were shared specially with anyone, they won't have access to the new files.
  • Version history seems to be lost.
  • Creation date on all the files is set to now.
1

I was suffering from same problem then I got solution by my own,

  1. go to the folder shared with me
  2. open the folder which you need to make your own ownership and in your drive
  3. select all the items in the folder
  4. right click and select create a copy
  5. problem solved files item will be in your drive
0

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.

1
  • Seems very slow. It says to copy 5000 files will take around 1 day.
    – Kidburla
    Commented Mar 7, 2021 at 13:45
0

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

1
  • 1
    I think you're answering a different question. The OP is trying to make a separate copy of a folder. Shift + Z adds a folder to a second parent folder, without making a separate copy.
    – browly
    Commented Jun 26, 2020 at 20:34
0

I found somewhat a simpler solution here.

  1. Open the drive
  2. Install the add-on (search: 'Copy URL to Google Drive')
  3. Make a copy of the shared folder in your Drive
  4. Make a target folder
  5. Use the add-on:
    • Login and Authenticate
    • Select the folder from the drive
    • Select the target folder
    • Start 'Copy'
  6. Wait
  7. Done

Please comment if something not works. Please like the video (it's not mine but sure it is helpful)

1
0

enter image description here

Make a copy of the files inside the shared folder. Drag all copies to your Google Drive folder on the left panel. Done!

enter image description here

1
  • As the question said, you can only make a copy of files, not folders. So this only works if your folder does not have any subfolders. Also, your initial copy is made inside the folder which you are trying to copy, so you would need to have write access to that folder AND that other person's Google Drive would need to have enough space for you to make that copy
    – Kidburla
    Commented Aug 23, 2023 at 9:17
0

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.

-1

4
  • 2
    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
  • @IonicăBizău what do you mean by "only adds the link" ?
    – user0
    Commented Sep 6, 2018 at 17:35
  • 1
    It does not copy the files in my drive. This was mentioned in the linked question. Commented Sep 7, 2018 at 6:24
  • It doesn't copy the files - which means if the original files are modified/deleted, they will be in your drive as well. this defeats the purpose of a copy, which is why it's called just a "link".
    – Kidburla
    Commented Mar 7, 2021 at 13:39
-1

As of January 2021, this functionality is built in:

First share the folder and give the recipient all permission:

enter image description here

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"

enter image description here

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.

1
  • This only works if you are the owner of the original files and hence can change the permissions in this way. In many cases, someone (who you may not even know, e.g. someone on an online forum) gave you a link to a shared folder; you can't ask them to follow this process.
    – Kidburla
    Commented Mar 7, 2021 at 13:40
-2

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

1
  • I just checked on Android and I can't see this option
    – Kidburla
    Commented Mar 7, 2021 at 13:44

Not the answer you're looking for? Browse other questions tagged or ask your own question.