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 someone who is leaving. If Alice is staying on for a week to hand off her work 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)
Two transfer tools, two orders
GAM has two ways to move a Drive, and they sit on different sides of GAM's documentation. The transfer drive command above is listed under Service Account Access: GAM does the work as the source user, file by file. Google's Admin console tool, and GAM's create datatransfer command listed under Client Access, go through Google's Data Transfer API instead, and Google's procedure for its own tool begins by suspending the owner: "Suspend the current owner's account. This action prevents them from creating or moving content during the transfer."
So the order depends on the tool. Run transfer drive while the account is still active, before you suspend; the GAM documentation does not say how it behaves against a suspended owner, and we have not tested it. If you would rather suspend first, which is Google's order, use the Admin console or the Data Transfer API command, after the same preview of what the account owns:
gam create datatransfer alice@example.org gdrive bob@example.org all
The last word matters. GAM's documentation gives three choices for Drive: private transfers only files that were never shared, shared transfers only files shared with others and is the default, and all transfers everything. A departing teacher's Drive is a mixture of both, so all is the choice that leaves nothing behind. Either way, transfer long before you delete. What actually has to happen when a teacher leaves walks through the whole order.
Sources
- GAM wiki: Users Drive Transfer — GAM7 documentation.
transfer drive, thepreviewandretainroleoptions, and the default folder name. - GAM wiki: Google Data Transfers — GAM7 documentation.
create datatransfer, and theprivate,sharedandallchoices for Drive. - Transfer Drive files to a new owner as an admin — Google Workspace Admin Help. Google's own transfer tool, whose first step is to suspend the current owner, and what happens to trashed files.