domainwidedelegation.comStart free

Use cases → Documents and Drive

Transfer Drive folder ownership between users

Reassign entire Drive folder hierarchies to a new owner, retaining sharing and structure, without manual intervention.

Who it is forIT administrators consolidating user accounts or managing offboarding at scale.
APIsDrive API, Admin SDK
Typical scopesdrive, admin.directory.user

The problem

Manual transfer of Drive folders is laborious, error-prone, and often misses nested files or shared permissions. Automating via delegated service account avoids missed content, but brings its own complications.

How it works

  1. Enumerate all files and subfolders beneath the target folder using the Drive API, following each child recursively.
  2. Invoke the Drive API's 'files.update' with the 'owner' field for each file and folder, specifying the new user.
  3. Update sharing permissions if required, to maintain access for collaborators.
  4. Log all changes and retry any item that fails due to transient errors.

What changes

The folder and all its contents appear under the new owner's Drive, with structure and permissions preserved.

The trap in this one. Ownership transfer of folders is not atomic: Drive API processes files and subfolders individually. If the process is interrupted or rate-limited mid-hierarchy, some files remain with the old owner, and there is no built-in transactionality. This means partial transfer is common unless you track and reconcile every item — and silent failures are possible if you don't check the response for each update.

Watch it explained

“Guidelines for configuring Google Drive API key with Documents Sharing Plugin - Google Docs Viewer” — SocialAppsTech on YouTube. Third-party video, included because it covers this ground well. We are not affiliated with the channel.

Questions people ask

Does this preserve sharing settings?

Generally yes, but files shared 'with link' that were visible due to the old owner's organisational context may become inaccessible if the new owner is external or under different restrictions.

How long does the transfer take to reflect?

Propagation is near-instant for small folders, but large hierarchies can take minutes to hours to appear in the new owner's Drive, especially if items are being indexed or permissions recalculated.

Want this built?

This is a pattern we run in production. We will set up the delegation and build this on top of it — $500 per hour, most of it working the same day.

Talk to us Or read the setup guide

Related use cases

Rotate Drive access for external collaborators via automation

Regularly expire and re-grant Drive file access for external users without manual intervention or missed revocations.

Enforce Drive storage quotas on a schedule

Identify and act on users who exceed Drive storage limits by scanning usage periodically and triggering clean-up or escalation.

Migrate Drive data between teams with delegated access

Move shared Drive content for a whole team between organisational units or domains, preserving permissions and structure with a delegated service account.