Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Se você tiver as permissões do IAM adequadas e as políticas da organização necessárias forem aplicadas, use a API Resource Manager para migrar um recurso de projeto entre os recursos da organização.
gcloud
Para migrar um projeto para outro recurso da organização, execute o seguinte comando:
PROJECT_ID é o ID ou o número do projeto que você quer
migrar.
ORGANIZATION_ID é o ID do recurso da organização para onde você quer
mover o projeto. Só é possível especificar um destino, seja um
recurso da organização ou uma pasta.
FOLDER_ID é o ID da pasta para onde você quer mover o projeto. Só é possível especificar um destino, seja uma pasta
ou um recurso de organização.
API
Usando a API Resource Manager v1, é possível migrar um projeto entre os recursos da organização definindo o
campo parent como o ID do recurso de destino.
Para migrar um projeto, faça o seguinte:
Receba o objeto project usando o método projects.get().
Defina o campo parent como o ID do recurso da organização ou o ID da pasta para onde você está movendo.
Atualize o objeto project usando o método projects.update().
O snippet de código a seguir demonstra as etapas acima:
Se você migrou um projeto por engano, pode reverter a operação executando a migração novamente, com a origem antiga como o novo destino e o destino antigo como a nova origem. Você precisa ter as permissões
do IAM e as políticas da organização necessárias para permitir isso
como se fosse uma migração totalmente nova.
Para reverter uma migração em que um projeto foi movido de Nenhuma organização para um recurso Organização, entre em contato com o Suporte ao cliente do Google Cloud.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-18 UTC."],[],[],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)."]]