移动项目时,直接附加的所有 Identity and Access Management 政策或组织政策都将与该项目一起移动。不过,资源层次结构中的项目也会受到它从父资源继承的政策影响。如果项目继承了为用户提供特定服务使用权的 IAM 角色,则用户在目标位置无权访问该服务,除非项目也将在目标位置继承权限。
例如,假设某服务账号在文件夹 A 中将 Storage Object Creator 角色绑定到某用户。该服务账号有权将数据上传到文件夹 A 中任何项目中的 Cloud Storage。如果您移动了其中一个项目,而文件夹 B 没有相同的继承权限,则该项目的服务账号将无法上传数据,从而导致服务中断。
如果组织政策在源文件夹和目标文件夹中定义,则这些注意事项也适用。与 IAM 政策一样,组织政策是继承的。因此,您必须确保源文件夹和目标文件夹之间的组织政策一致。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-18。"],[],[],null,["# Moving a project\n\nThis guide explains how to move a project within your organization resource.\n\nThe project is the base-level organizing entity in a\nGoogle Cloud organization resource. Projects are created\nunder organization resources, and can be placed under folders or the organization\nresource itself, forming the\n[resource hierarchy](/resource-manager/docs/cloud-platform-resource-hierarchy). You can move project\nresources within your resource hierarchy, but should consider the policy\nimplications of the move before you make it.\n| **Note:** The following instructions are only for moving a project within an organization resource. For information about migrating a project between organization resources, see [Migrating projects](/resource-manager/docs/project-migration).\n\nWhen you move a project, any Identity and Access Management policies or organization policies that\nare directly attached will move with it. However, a project in your resource\nhierarchy is also affected by the policies that it inherits from parent\nresources. If a project inherits an IAM role that provides users\npermission to use a particular service, users will not have access to that\nservice at the destination unless it would inherit the permission at the\ndestination as well.\n\nFor example, consider a service account has the **Storage Object Creator**\nrole bound to a user at Folder A. The service account has permissions to upload\ndata to Cloud Storage in any project in Folder A. If you moved one of these\nprojects to Folder B, which does not have the same inherited permissions, the\nservice account for that project loses the ability to upload data, resulting in\na service outage.\n\nThese same considerations apply if organization policies are defined at the\nsource and destination folders. Like IAM policies, organization\npolicies are inherited. Consequently, you must ensure that your organization\npolicies are consistent between source and destination folders.\n\nTo learn more about organization policies, see\n[Introduction to the organization Policy Service](/resource-manager/docs/organization-policy/overview).\n\nTo move a project, you need the Project Mover IAM role\n(`roles/resourcemanager.projectMover`) on both the source folder and the\ndestination folder. If the resource is not in a folder, you need this role on\nthe organization resource.\n\nThese roles give you the following required permissions:\n\n- `resourcemanager.projects.update` on the project\n- **If the resource is in a folder:** `resourcemanager.projects.move` on the source folder and the destination\n- **If the resource is not in a folder:** `resourcemanager.projects.move` on the organization resource\n\nYou can also gain these permissions with [custom\nroles](/iam/docs/creating-custom-roles), or other predefined roles. \n\n### Console\n\nTo move a project:\n\n1. In the Google Cloud console, go to the **Manage resources** page.\n\n [Go to Manage resources](https://console.cloud.google.com/cloud-resource-manager)\n\n \u003cbr /\u003e\n\n2. Select your Organization from the **Organization** drop-down on the top\n left of the page.\n\n3. Click on your project's row to select your project from the list of\n resources. Note that you *must not* click on the name of the\n project, which takes you to the project's IAM page.\n\n4. Click on the options menu (the vertical ellipsis) in the row and click\n **Move**.\n\n5. Click **Browse** to select the folder to which you want to move the\n project.\n\n6. Click **Move**.\n\n### gcloud\n\nTo move a project, run the\n[`gcloud beta projects move`](/sdk/gcloud/reference/beta/projects/move)\ncommand: \n\n```\ngcloud beta projects move PROJECT_ID \\\n--DESTINATION_TYPE DESTINATION_ID\n```\n\nWhere:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e is the ID or number of the project you wish to\n move.\n\n- \u003cvar translate=\"no\"\u003eDESTINATION_TYPE\u003c/var\u003e is either `organization` or `folder`.\n\n- \u003cvar translate=\"no\"\u003eDESTINATION_ID\u003c/var\u003e is the ID of the organization resource or folder to which\n you want to move the project. You can only specify one target.\n\n### API\n\nYou can use the v3\n[`projects.move`](/resource-manager/reference/rest/v3/projects/move) method\nto move a project.\n\nRequest: \n\n```\nPOST https://cloudresourcemanager.googleapis.com/v3/{name=PROJECT_NAME}:move\n{\n \"destinationParent\": DESTINATION_PARENT\n}\n```\n\nWhere:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e is the name of the project you want\n to update. For example, `projects/415104041262`\n\n- \u003cvar translate=\"no\"\u003eDESTINATION_PARENT\u003c/var\u003e is the new parent organization resource\n or folder under which you want to move the project. For example:\n `organizations/12345678901`\n\nIf successful, the request will return an\n[Operation](/resource-manager/reference/rest/Shared.Types/Operation) which\ncan be used to track the project move."]]