Moving Google Docs and Folders From an External Share Drive

52 views
Skip to first unread message

Ed Lawless

unread,
Mar 28, 2025, 2:07:03 PMMar 28
to GAM for Google Workspace
Good Afternoon,
I have another share drive move that is a little bit complicated and I think I understand the syntax; but would like to run it by some additional seasoned pros.  We need to do a move to maintain the document IDs this way the links don’t break.

Here is the scenario:
The school district that I work for hired a vendor to write us a series of workbooks for use by our math instructors.  The workbooks were completed on an external Google share drive that is part of the vendors Google workspace org.  We want to take ownership of these workbooks and bring them inside our Google organization; so, we are not dependent on the vendor to continue to host the created content for us.  I did some reading; it looks like I would need the vendor to give me Manager access to the external share drive and then we would standup an internal share drive inside our org and kick off the transfer process to this new internal share.  If I am doing the file transfer via GAM to the internal share drive as the district google admin, when I configure the internal share drive I would not need to enable “Allow people outside X organization to access files” unless I was going to allow the vendor access to our new share drive after the transfer is completed.  
Does my logic check out?  I started formulating the syntax and came up with this:
 
gam redirect stdout .\movefilestosd.txt redirect stderr stdout user <Account that has manager access to both external and internal share drives> move teamdriveparentid <external Drive ID> teamdriveparentid <new internal share drive> duplicatefolders duplicatename duplicatefiles duplicatename copysubfolderpermissions false retainsourcefolders

After we run the command then the vendor could shut off the external share drive access because the drive would be empty with the exception of the retained source folders skeleton.  I could leave that last switch off (retainsourcefolders) if you think it would be a better idea.  I just want to be sure we have our ducks in a row because we do not want to lose the existing doc ids on the documents or structure that are currently hosted on this external share.  

Appreciate the guidance  and feedback in advance.  
Thanks, 
Ed

Ross Scroggs

unread,
Mar 28, 2025, 3:50:58 PMMar 28
to google-ap...@googlegroups.com
Ed,

Send me a private Meet/Zoom invitation to discuss.

Ross
----
Ross Scroggs



Email correspondence to and from this address is subject to public records requests pursuant to the North Carolina Public Records Law, resulting in monitoring and potential disclosure of this message to third parties.

In compliance with federal law, Charlotte-Mecklenburg Schools administers all education programs, employment activities and admissions without discrimination against any person on the basis of gender, race, color, religion, national origin, age or disability.

--
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 visit https://groups.google.com/d/msgid/google-apps-manager/f206946d-5dd1-4644-8042-c3a8ea068cc2n%40googlegroups.com.

Ed Lawless

unread,
Dec 4, 2025, 11:36:24 AM (3 days ago) Dec 4
to GAM for Google Workspace

Good Morning, 
I know it has been a minute since we have discussed the above scenario; this has a lot to do with trying to get together with the vendor and actually see the data share itself.  Ross, I appreciate the fact that we met back in April and we discussed a way to script moving all the files from an external share drive to an internal share drive inside our org.  

When I met with the vendor after this meeting it was brought to my attention what they were calling a "share drive" is actually a my drive folder that belongs to one of the users inside the vendors organization.  Currently that shared my drive folder has been shared with people inside our school district so our employees have been creating files and storing them in the shared folder structure but they belong to our employees.  The trick here is that we want to migrate this all under our Google org; but we want to be careful not to lose the current folder structure.  

So I think the way this is going to work, we have to have the vendor's admin move the "my drive" folder and files they can to the share drive the vendor creates inside there google org.  (I will refer to this as the external team drive.)  They will also need to make sure that our Google Admins have access to this external share as managers.  However, because they don't own the files created by people inside our org, I will have to also run a move on this my drive folder to get the documents that belong to our org that is mixed in with the vendors documents.  The big concern is that we do not want to lose the folder structure because of the collaboration between the district's math department and the vendor firm that helped create the work books.  What makes this difficult is that they don't have a google admin on there side; so they are in the process of hiring someone to help us complete this task; because I don't want the responsibility of working both sides of this fence.  

So here is what I am envisioning: 
Both the vendor admin and myself would run the following commands:

Vendor firm getting the initial load to the external share drive:  
gam redirect stdout .\MoveFilesToSdContractedFirm.txt redirect stderr stdout user <superadmin user> move drivefile <contracted firms my drive ID> teamdriveparentid <External teamdrive ID> mergewithparent duplicatefolders duplicatename duplicatefiles duplicatename copysubfolderpermissions false retainsourcefolders
(Only the first pass)  After, we need to exclude "duplicatefolders duplicatename" so we don't duplicate folders over and over if we need to run it a second time.  

Then from school district  side we would need to run: 
gam redirect stdout .\MoveFilesToSdContractedFirm from district.txt redirect stderr stdout user <superadmin user> move drivefile <contracted firms my drive ID> teamdriveparentid <External teamdrive ID> mergewithparent duplicatefiles duplicatename copysubfolderpermissions false retainsourcefolders

I have two concerns:  When we run the first command on the contractors side the files in the my drive folder that are owned by our employees GAM is not going to not move them; instead it will create shortcuts.  Will this be a concern when I run the 2nd command that will affectively transfer the ownership temporarily to the vendor firm as we move our staffs documents to the external team drive owned by vendor.  Also notice that the 2nd command I have excluded "duplicatefolders duplicatename" so that we don't start creating the folders again from our side.

After both of these commands are ran; we should still have a skeleton structure in the original my drive location from the vendor.  The only things left should be documents that are not owned by either the vendor or our district org.  Mainly, personal gmail accounts or additional orgs.  The vendor firm is working to get there staff to correct the documents that were put there with personal accounts.  I am trying to give these people grace because I know they are not IT folks and they don't understand our mindset.  But I am realizing this is a really deep rabbit hole, that we went down.  

Once we have everything in the external share and everyone is pleased with the state of the skeleton folder structure on the original my drive folder.  We want to transfer the external share data to a share drive inside our district org to take ownership from the vendor.  So at that point we will stand up a new share drive inside our org and run the following commands: 

gam redirect csv ./topvenderstuff.csv user <super admin user> print filelist select teamdriveid  <External teamdrive ID>   depth 0 fields id,name

**  Make sure that you specify depth 0 – failure to do will flatten the file structure.  

After we have the above topvenderstuff.csv we can then run the following command to move the files from the vendor share drive to our internal share drive.  The teams drive that we specify below will be the target.  
gam redirect stdout ./movevenderstuff.txt multiprocess redirect stderr stdout csv topvenderstuff.csv gam user ~Owner update drivefile ~id teamdriveparentid <our internal org team drive ID> 

What else do we need to be thinking about? 
Thanks, 
Ed

Ross Scroggs

unread,
Dec 5, 2025, 10:51:38 AM (2 days ago) Dec 5
to google-ap...@googlegroups.com
Ed,

Send me a private Meet/Zoom invitation to discuss.

Ross
----
Ross Scroggs


Reply all
Reply to author
Forward
0 new messages