Copying MyDrive data to a Shared Drive folder without the source's share settings on folders

1,100 views
Skip to first unread message

Colleen Schmidt

unread,
Jan 31, 2023, 12:31:40 PM1/31/23
to GAM for Google Workspace
 Hi everyone,

We plan on automating a process for departed employees, including copying the departed employee's MyDrive to a folder on a Shared Drive. The part I'm having issues with is a test folder on the user's MyDrive is coming over to the Shared Drive with their original sharing permissions. I would like to have those permissions stripped on the copy, as I have successfully done with the files that had sharing permissions when in their MyDrive.

gam version: GAMADV-XTD3 6.31.01

command:
gam csv testemail-rootid.csv gam user test...@tcnj.edu copy drivefile ~ID teamdriveparentid <SharedDriveIDhere> newfilename testemail mergewithparent no copymergewithparentfolderpermissions false copyfileinheritedpermissions false recursive depth -1

It makes no difference if I take out the "copymergewithparentfolderpermissions" option, keep it in as false, or set it to true... the test folder is still shared with our other test accounts on the Shared Drive.

I must be missing something. Any suggestions?

Thanks!

Colleen Schmidt

Don Beck

unread,
Jan 31, 2023, 2:20:34 PM1/31/23
to GAM for Google Workspace
I do a two step process
First I do a datatransfer of their My Drive to my Admin Accounts My Drive

gam create datatransfer old...@domain.com gdrive ad...@domain.com privacy_level shared,private

Then depending on where they physically worked, I move that folder to the appropriate shared drive

gam user ad...@domain.com move drivefile id <My Drive Folder ID> parentid <Account Shared Drive Folder ID>



Colleen Schmidt

unread,
Jan 31, 2023, 3:10:20 PM1/31/23
to GAM for Google Workspace
Thanks for your steps. I appreciate seeing how others are dealing with similar situations. 

We allow the person to still export their information for a short time period. So, unfortunately, I can't do the datatransfer. We put the departed employee in a ZeroQuota group to allow those that have received shared files/folders from this user to see that the items are now "read-only." We make a copy of the departed employee's MyDrive on the off chance that they actually delete any items during the offboarding process. After a certain amount of time, we delete the departed user's MyDrive; then 3 months after that, we will delete the data from the Shared Drive. 

Ross was kind enough to meet with me and this is the command that was developed to copy the user's MyDrive to a Shared Drive without their original sharing permissions:

gam user test...@tcnj.edu copy drivefile root teamdriveparentid <SharedDriveIDhere> newfilename testemail mergewithparent no copytopfolderpermissions false copysubfolderpermissions false copyfilepermissions false recursive

John Adams

unread,
Apr 18, 2023, 11:22:13 AM4/18/23
to GAM for Google Workspace
I'm having some trouble duplicating this. When I enter this command:

gam user user...@ualr.edu copy drivefile root teamdriveparentid shared-drive-id newfilename user...@ualr.edu mergewithparent no copytopfolderpermissions false copysubfolderpermissions false copyfilepermissions false recursive


I get this result:

User: user...@ualr.edu, Copy 1 Drive File/Folder

User: user...@ualr.edu, Drive File Not Copied: shareddriveparentid: shared-drive-id, Does not exist

Ross Scroggs

unread,
Apr 18, 2023, 12:05:34 PM4/18/23
to google-ap...@googlegroups.com
John,

Is shared-drive-id the name of a shared drive? If so, you want teamdriveparent shared-drive-id

Ross

--
You received this message because you are subscribed to the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/b705ad6f-18a1-4856-83c8-c49389b4155cn%40googlegroups.com.


--

Johnnie W Adams

unread,
Apr 18, 2023, 12:06:56 PM4/18/23
to google-ap...@googlegroups.com
Hi, Ross,

     shared-drive-id is the ID of the shared drive.

Thanks,

     John A

You received this message because you are subscribed to a topic in the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/M-h4Xyi5cLM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/CAJkvRS_v48PfAALie%3DgvYgC7WN_OntvsERbhE6L%2BxMLXk%2BdDrw%40mail.gmail.com.


--
John Adams
Senior Linux/Middleware Administrator  | Information Technology Services
+1-501-916-3010 | jxa...@ualr.edu | http://ualr.edu/itservices
UA Little Rock

Reminder:  IT Services will never ask for your password over the phone or in an email. Always be suspicious of requests for personal information that come via email, even from known contacts.  For more information or to report suspicious email, visit IT Security.

Ross Scroggs

unread,
Apr 18, 2023, 12:08:11 PM4/18/23
to google-ap...@googlegroups.com
John,

If shared-drive-id is an actual id, the you do want  teamdriveparentid, is user user...@ualr.edu an organizer of that drive/

Ross
--

Johnnie W Adams

unread,
Apr 18, 2023, 12:11:20 PM4/18/23
to google-ap...@googlegroups.com
Hi, Ross,

     user user...@ualr.edu is the owner of the My Drive I'm trying to move.

Thanks,

     John A

You received this message because you are subscribed to a topic in the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/M-h4Xyi5cLM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/CAJkvRS8mk%2BZkohskveKyiiJHSZKx2aVSMjU%3D2QnWSkuxvVu8%3DQ%40mail.gmail.com.

Ross Scroggs

unread,
Apr 18, 2023, 12:14:00 PM4/18/23
to google-ap...@googlegroups.com
Johnnie,

Send me a Meet/Zoom invitation.

Ross



--

Jonathan Moreen

unread,
Apr 25, 2023, 12:25:58 PM4/25/23
to GAM for Google Workspace
Hi Ross,

We are trying to copy the entire contents of a My Drive to a Shared Drive and are using the following command:

gam user <username> copy drivefile <My-Drive-ID> recursive copysubfiles true copysubfolders true teamdriveparentid <Shared-Drive-ID> duplicatefiles uniquename copyfilepermissions no

The command seemingly copies the files just file, but once it tries to copy any subfolders it comes up with the following error:

ERROR: 403: parentNotAFolder - The specified parent is not a folder.

Any idea what might be causing the above error? Thanks in advance!


Ross Scroggs

unread,
Apr 25, 2023, 12:36:06 PM4/25/23
to google-ap...@googlegroups.com
There was a bug fixed in 6.52.07 that addressed this error.
Update to the current version 6.57.08

Ross



--

Jonathan Moreen

unread,
Apr 25, 2023, 2:52:01 PM4/25/23
to GAM for Google Workspace
Thanks Ross. I will update to 6.57.08 and try again.

Sidh Ware

unread,
Jun 7, 2023, 3:45:11 PM6/7/23
to GAM for Google Workspace
Hi Ross, 

I've updated my GAM version to 6.60.06. However, I'm still getting the same error "User: us...@test.com, Drive File Not Copied: shareddriveparentid: fasfsdfasgsag456466UfKR4EBjxs83rd0K, Does not exist"

Here is the command I ran - 
gam user us...@test.com copy drivefile root recursive teamdriveparentid 1hf5fg5d5Lwol6nZxEGxw1kusSmm3Xe mergewithparent false

Please advise..

Ross Scroggs

unread,
Jun 7, 2023, 3:47:31 PM6/7/23
to google-ap...@googlegroups.com
What does this show:

gam user us...@test.com show fileinfo 1hf5fg5d5Lwol6nZxEGxw1kusSmm3Xe 

Ross



--

Sidh Ware

unread,
Jun 7, 2023, 3:51:34 PM6/7/23
to GAM for Google Workspace
same...Does not exist

Ross Scroggs

unread,
Jun 7, 2023, 4:04:12 PM6/7/23
to google-ap...@googlegroups.com
You can't copy files to a folder you don't have access to, you need to give the user access to that Shared Drive.

Ross



--

Sidh Ware

unread,
Jun 7, 2023, 4:11:37 PM6/7/23
to GAM for Google Workspace
Thank you for your quick response, Ross. Appreciated. 

I'm trying to copy the user's personal drive data to the shared drive folder. 
I've access to the destination drive. Do I need to add a user to that drive access?

Regards
Sidh

Sidh Ware

unread,
Jun 7, 2023, 4:29:17 PM6/7/23
to GAM for Google Workspace
Thank you, Ross. It's working after adding the user's access.

Appreciate your help.

Reply all
Reply to author
Forward
0 new messages