This guide explains how to move a project within your organization.
The project resource is the base-level organizing entity in aGoogle Cloud organization. Projects are createdunder organizations, and can be placed under folders or the organizationresource itself, forming theresource hierarchy. You can move projectresources within your resource hierarchy, but should consider the policyimplications of the move before you make it.
When you move a project, any Identity and Access Management policies or organization policies thatare directly attached will move with it. However, a project in your resourcehierarchy is also affected by the policies that it inherits from parentresources. If a project inherits an IAM role that provides userspermission to use a particular service, users will not have access to thatservice at the destination unless it would inherit the permission at thedestination as well.
For example, consider a service account has the Storage Object Creatorrole bound to a user at Folder A. The service account has permissions to uploaddata to Cloud Storage in any project in Folder A. If you moved one of theseprojects Folder B, which does not have the same inherited permissions, theservice account for that project loses the ability to upload data, resulting ina service outage.
These same considerations apply if organization policies are defined at thesource and destination folders. Like IAM policies, organizationpolicies are inherited. Consequently, you must ensure that your organizationpolicies are consistent between source and destination folders.
To learn more about organization policies, seeIntroduction to the organization Policy Service.
To move a project, you need the Project Mover IAM role(roles/resourcemanager.projectMover
) on both the source folder and thedestination folder. If the resource is not in a folder, you need this role onthe organization node.
These roles give you the following required permissions:
resourcemanager.projects.update
on the project- If the resource is in a folder:
resourcemanager.projects.move
on thesource folder and the destination - If the resource is not in a folder:
resourcemanager.projects.move
on theorganization node
You can also gain these permissions with customroles, or other predefined roles.
Console
To move a project:
In the Google Cloud console, go to the Manage resources page.
Select your Organization from the Organization drop-down on the topleft of the page.
Click on your project's row to select your project from the list ofresources. Note that you must not click on the name of theproject, which takes you to the project's IAM page.
Click on the options menu (the vertical ellipsis) in the row and clickMove.
Click Browse to select the folder to which you want to move theproject.
Click Move.
(Video) Create Folders and Projects in Google Cloud Organization Hierarchy |Demo in Action: Part-1
gcloud
To move a project, run thegcloud beta projects move
command:
gcloud beta projects move PROJECT_ID \--DESTINATION_TYPE DESTINATION_ID
Where:
PROJECT_ID is the ID or number of the project you wish tomove.
DESTINATION_TYPE is either
organization
orfolder
.DESTINATION_ID is the ID of the organization or folder to whichyou want to move the project. You can only specify one target.
API
You can use the v3projects.move
methodto move a project.
Request:
POST https://cloudresourcemanager.googleapis.com/v3/{name=PROJECT_NAME}:move{ "destinationParent": DESTINATION_PARENT}
Where:
PROJECT_NAME
is the name of the project you wantto update. For example,projects/415104041262
DESTINATION_PARENT
is the new parent organizationor folder under which you want to move the project. For example:organizations/12345678901
If successful, the request will return anOperation whichcan be used to track the project move.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-01-11 UTC.
[{ "type": "thumb-down", "id": "hardToUnderstand", "label":"Hard to understand" },{ "type": "thumb-down", "id": "incorrectInformationOrSampleCode", "label":"Incorrect information or sample code" },{ "type": "thumb-down", "id": "missingTheInformationSamplesINeed", "label":"Missing the information/samples I need" },{ "type": "thumb-down", "id": "otherDown", "label":"Other" }] [{ "type": "thumb-up", "id": "easyToUnderstand", "label":"Easy to understand" },{ "type": "thumb-up", "id": "solvedMyProblem", "label":"Solved my problem" },{ "type": "thumb-up", "id": "otherUp", "label":"Other" }]