[[["易于理解","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-09-04。"],[],[],null,["# Perform the migration\n\nIf you have the appropriate\n[IAM permissions](/resource-manager/docs/assign-iam-roles) and the required\n[organization policies](/resource-manager/docs/configure-org-policy) are enforced, you can\nuse the Resource Manager API to migrate a project resource between organization resources.\n**Note:** The following instructions are only for migrating a project from one organization resource to another organization resource. If the project you want to migrate is not associated with an organization resource, see [Migrating projects with no organization resource](/resource-manager/docs/handle-special-cases#migrating_projects_no_org). \n\n### gcloud\n\nTo migrate a project to another organization resource, run the following command: \n\n```\ngcloud beta projects move PROJECT_ID \\\n --organization ORGANIZATION_ID\n```\n\nYou can also specify a folder as the target resource, with the following\ncommand: \n\n```\ngcloud beta projects move PROJECT_ID \\\n --folder FOLDER_ID\n```\n\nReplace the following fields:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e is the ID or number of the project you wish to migrate.\n- \u003cvar translate=\"no\"\u003eORGANIZATION_ID\u003c/var\u003e is the ID of the organization resource to which you want to move the project. You can only specify one target, either an organization resource or a folder.\n- \u003cvar translate=\"no\"\u003eFOLDER_ID\u003c/var\u003e is the ID of the folder to which you want to move the project. You can only specify one target, either a folder or an organization resource.\n\n| **Note:** You can execute this command regardless of your Google Cloud CLI scope.\n\n### API\n\nUsing the v1 Resource Manager API, you can migrate a project between organization resources by setting its\n`parent` field to the ID of the destination resource.\n\nTo migrate a project, do the following:\n\n- Get the `project` object using `projects.get()` method.\n- Set its `parent` field to the organization resource ID of the organization resource, or the folder ID of the folder to which you are moving it.\n- Update the `project` object using `projects.update()` method.\n\nThe following code snippet demonstrates the steps above: \n\n project = crm.projects().get(projectId=flags.projectId).execute()\n project['parent'] = {\n 'type': 'organization',\n 'id': flags.organizationId\n }\n\n project = crm.projects().update(\n projectId=flags.projectId, body=project).execute()\n\n### Roll back a migration\n\nIf you have mistakenly migrated a project, you can roll back the operation by\nperforming the migration again, with the old source as the new destination, and the\nold destination as the new source. You must have the necessary\nIAM permissions and organization policies enforced to allow this\nas if this were an entirely new migration.\n\nTo roll back a migration where a project was migrated from **No organization** to an **Organization** resource, contact [Google Cloud Customer Care](/support)."]]