How to migrate a user's files to a shared drive

6,456 views
Skip to first unread message

Lior W.

unread,
Jun 21, 2021, 9:14:00 AM6/21/21
to GAM for Google Workspace
Hi,

https://admin.google.com/ac/drive/transferownership allows transferring ownership of all of a user's files to another user.
But the original user left the company and the goal is to move their files into a shared folder.
Can it be done in GAM?

sdvpaqfs.png

Joan Romero

unread,
Jun 21, 2021, 5:07:59 PM6/21/21
to GAM for Google Workspace
I think you can't do it with the transfer command, maybe you could use the copy command. 

gam user us...@domain.com copy drivefile  ID recursive copysubfileparents all copysubfolderparents all teamdriveparentid SHAREDRIVEID duplicatefiles uniquename copyfilepermissions yes

Lior W.

unread,
Jun 22, 2021, 1:50:21 AM6/22/21
to GAM for Google Workspace
I don't want to lose the files' history, etc.
Do you mean I can't transfer someone else's files and folders into a shared drive? Or can't GAM transfer even my own files and folders into a shared folder?
If it's the former, what about using myself as a middleman?
As in running 2 commands one after another:
  1. Transfer ownership of a user's files and folders into myself, preferably under a certain folder (My Drive\The other user\).
  2. Transfer them (either catching them from the first run or using the dedicated folder) into the shared drive.

Joan Romero

unread,
Jun 22, 2021, 9:38:37 AM6/22/21
to GAM for Google Workspace
I don't have much experience with these commands but you could run a simple test with the copy command and see if you lose the file history. 

Peter Smulders

unread,
Jun 22, 2021, 11:02:42 AM6/22/21
to GAM for Google Workspace
'Copy' obviously makes a copy, but 'move' retains both the version history and the "handling" history.

The easiest way to deal with this is to have the account active (even though the user might have left). Without this, you might be able to grab the ownership of the files, but I'm not sure that without an active owner, you can get an accurate and current list of files and folders to grab the ownership of.

I routinely move the ownership from a range of users to a 'centrally managed' account. The cleanest way i found is to have a script add ACLs in name of the user reflecting how you would like access to be. Once ownership is transferred to a stable account, you can move files around to wherever you like, whenever you like.

With GAMADV-XTD3 you can move file directly to a Shared Drive, which seems to be the shortest path to what you are looking for. Set up a Shared Drive "Inheritances" or something and a subfolder per user that has left, then move all folders and files across.

Note: select for files owned by user, so as to avoid messing around with files that were merely shared with this user. (this kind of operation is why we advocate only sharing with groups and never with single users -- user leaves --> take out of group(s) --> access rights are gone)

hth -- Peter

Ross Scroggs

unread,
Jun 22, 2021, 2:03:59 PM6/22/21
to google-ap...@googlegroups.com
Lior,


Here is a basic example that moves all of a user's files into an existing folder on a Shared Drive.

gam user us...@domain.com move drivefile root teamdriveparentid <FolderIDonSharedDrive> mergewithparent


Folders are recreated on the Shared Drive with their original permissions; they will have new

Drive File IDs.


Files are not changed other than to update their parent.


Files in the folder structure owned by users outside of your domain can't be moved.


It would be best to create a test user, build a sample folder structure that has similar elements to the

actual user and move that user.


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/14d1a0b9-0d4c-4776-84c9-cddc00320e8an%40googlegroups.com.


--

Lior W.

unread,
Jun 22, 2021, 2:52:44 PM6/22/21
to GAM for Google Workspace
Does it mean only Advanced GAM knows how to move into a shared drive? How come?

Ross Scroggs

unread,
Jun 22, 2021, 3:22:24 PM6/22/21
to google-ap...@googlegroups.com
Lior,

It's called Advanced because it has many more features.

Ross



--
Reply all
Reply to author
Forward
0 new messages