How to transfer Google Drive ownership with GAM

One GAM7 command moves ownership of a user's Drive files to someone else. Here is the command, its built-in preview, what it leaves the old account by default, and the trash rule that loses files for good.

A teacher leaves, and ten years of lesson plans, gradebooks and department folders are sitting in their Drive. Suspending the account keeps them. Deleting it does not. Somewhere in between, ownership has to move to someone who is staying.

The short answer

Run the preview first. GAM has one built in:

gam user alice@example.org transfer drive bob@example.org preview

In the documentation's words: "Use the preview option to output a CSV file showing the files to be transferred without actually performing the transfer." (GAM wiki: Users Drive Transfer)

Then transfer:

gam user alice@example.org transfer drive bob@example.org

What moves, and what the old account keeps

Everything except the trash. "By default, all of the source users files will be transferred except those in the trash."

Into a folder named after the old account. "If targetuserfoldername is not specified, the default value #user# old files will be used." Bob finds a new folder carrying Alice's address, with her files inside, rather than her files scattered through his Drive.

The old account keeps nothing. "retainrole none - The source user retains no access to the files; this is the default." Usually right for a leaver. If Alice is staying on for a week of handover and needs to see her old files, give her a role:

gam user alice@example.org transfer drive bob@example.org retainrole reader

Shared drives are not part of it. Files in a shared drive belong to the shared drive, not to the person who made them, so they were never Alice's to hand over.

The trash rule

Trashed files stay behind, and Google's own transfer documentation spells out what that means later: "If you delete the user, untransferred files in Trash are deleted, too." (Transfer Drive files to a new owner as an admin) Google's advice for its own tool applies just as well here: "If you want to transfer files that are in Trash, move the files out of Trash."

Ask before you transfer, not after you delete. The file somebody "definitely didn't need" and binned in May is the one the department asks for in October.

Google's own tool, for comparison

The Admin console has a transfer tool of its own, and it behaves a little differently. Everyone involved hears about it: "The new owner, the previous owner, and the admin who started the transfer get a confirmation email." And it has a time limit: "If a transfer takes longer than 36 hours, it's unsuccessful and will stop." (Transfer Drive files to a new owner as an admin)

Where this fits

Transfer before you suspend, and long before you delete. What actually has to happen when a teacher leaves walks through the order and why it matters.

Sources


In ORINEX Workspace, a Drive transfer is one step of offboarding, run while the account is still active, and transfers Google is still working through in the background are tracked on the Drive Transfers page. What ORINEX Workspace does.