将数据迁移至Google Workspace共享云端的跨域所有权问题求助
跨域Google Drive文件迁移解决方案
这确实是跨域Drive迁移里挺头疼的问题,我之前帮客户处理过类似情况,给你几个可行的方案,按操作简便程度排序:
方案1:让AccountC直接将文件夹转移到Shared Drive(最推荐)
因为AccountC是Directory2的所有者,他拥有直接转移文件夹到Shared Drive的权限,只要你给他目标Shared Drive的编辑权限就行:
- 你用AccountB(或DomainA管理员)打开目标Shared Drive,添加AccountC的个人账户邮箱为「编辑」权限;
- 让AccountC登录自己的Google Drive,找到Directory2,右键点击选择「转移到共享云端」;
- 在弹出的窗口里选择你指定的Shared Drive,确认转移即可。
这个方法全程不需要下载上传,Google Sheets/Docs会保持原格式,整个文件夹的结构和权限也会同步过去,转移完成后你可以随时移除AccountC在Shared Drive的权限。
方案2:临时将AccountC加入DomainA Workspace,转移所有权后移除
如果AccountC愿意配合,临时加入你的域就能绕过所有权转移的跨域限制:
- DomainA管理员登录Workspace后台,将AccountC的个人账户邮箱添加为域内的临时外部成员(或临时员工账号);
- AccountC登录自己的Drive,找到Directory2,右键点击「共享」→「高级」→「转移所有权」,选择AccountB完成转移;
- 所有权转移完成后,管理员再从Workspace后台移除AccountC的临时权限即可。
这个方法适合需要将文件所有权完全转移到DomainA账户的场景,转移后AccountB就能自由管理这些文件了。
方案3:用Google Apps Script批量复制文件(适合AccountC无法直接操作但能授权脚本的情况)
如果AccountC不方便直接操作,但愿意授权一个简单脚本,你可以用Google Apps Script批量复制文件到Shared Drive:
- 让AccountC打开Google Apps Script编辑器(不用跳转,直接告诉用户在Google里搜这个就行);
- 新建一个脚本项目,替换成以下代码:
function copyFolderToSharedDrive() { // 替换成实际的文件夹ID和Shared Drive ID const sourceFolderId = "Directory2的文件夹ID"; const targetDriveId = "目标Shared Drive的ID"; const targetParentFolderId = "Shared Drive里要存放的父文件夹ID(可选,直接放根目录可删除这行)"; const sourceFolder = DriveApp.getFolderById(sourceFolderId); // 获取目标Shared Drive的根文件夹(如果指定了父文件夹就用父文件夹) const targetParent = targetParentFolderId ? DriveApp.getFolderById(targetParentFolderId) : DriveApp.getFolderById(targetDriveId); // 递归复制文件夹和文件 function copyFolderRecursive(source, targetParent) { const newFolder = targetParent.createFolder(source.getName()); // 复制文件 const files = source.getFiles(); while (files.hasNext()) { const file = files.next(); file.makeCopy(file.getName(), newFolder); } // 复制子文件夹 const subFolders = source.getFolders(); while (subFolders.hasNext()) { const subFolder = subFolders.next(); copyFolderRecursive(subFolder, newFolder); } } copyFolderRecursive(sourceFolder, targetParent); console.log("复制完成!"); }
- 让AccountC点击「运行」,授权脚本访问他的Drive权限;
- 运行完成后,Shared Drive里就会出现完整的Directory2副本,所有Google原生文件(Sheets/Docs/Slides)都会保持原格式。
复制完成后,你可以在Shared Drive里调整文件的访问权限,确保DomainA团队成员能正常使用。
内容的提问来源于stack exchange,提问作者MKZ
相关产品推荐
相关产品推荐

