Reputation: 21
I had created a project on GCP to run my mobile app and I was on a free trial and before I realized the trial ended and I lost my project, I wanted to see if I can recover and migrate that project to my company's gcp account that I just created.
thanks!
Upvotes: 2
Views: 9059
Reputation: 41
The answers above don't mention that after project migration, Billing remains assigned to the billing account from the old organization. Remember to assign your project to the billing account from new organization.
After recent updates in Google Cloud, all preparatory steps for project migration (assigning appropriate user permissions in both organizations, managing policy permissions and changing Billing) can be performed via the browser interface, without the need to use gcloud commands. The gcloud command will be required only at the final step - for performing project migration:
gcloud beta projects move PROJECT_ID --organization DESTINATION_ORGANIZATION_ID
Here is a step by step guide on how to migrate the GCP project from one organization to another using GCP interface and only one gcloud command.
Upvotes: 3
Reputation: 187
In regards to move the projects between organizations[1], here is a summary of permissions and policies that are needed:
Permissions on the Source organization :
The person moving the project needs to have roles/resourcemanager.projectMover
on the organization. Alternatively, the person can have resourcemanager.projects.update
permission on the project and have resourcemanager.projects.move
permission on the parent (organization).
Permissions on the destination organization :
The same person moving the project needs to have roles/resourcemanager.projectCreator
on the organization.
Organization policy permissions:
On the parent resource to the project you want to move, set an organization policy that includes the constraints/resourcemanager.allowedExportDestinations
constraint. On the destination resource, set an organization policy that includes the constraints/resourcemanager.allowedImportSources
constraint.
On the source and destination organization resources, you must have the roles/orgpolicy.policyAdmin
role, which grants permission to create and manage organization policies.
Upvotes: 2
Reputation: 1527
Projects within GCP undergo a 30 day grace period before the resources are fully deleted. As the Project needs an active Billing account, which is automatically closed if you did not opt to upgrade it to a Paid Account.
If the Project is already past 30 day grace period, the resources on that project are now fully deleted and cannot be recovered.
For your question on Migrating the Project from one Organization to another.
You would need to:
Give the email account the Project Mover
(*access to update and move projects) role on the Project to be moved.
Give the email account the Project Creator
role on the destination Organization
On the Source and Destination Organizations, you will need the roles/orgpolicy.policyAdmin
(Organization Policy Admin) role or you can just give the email account the Organization Admin role for both Organizations
Check below constraints (this is in IAM & Admin > Organization Policies):
a. Source Org > Allow constraints/resourcemanager.allowedExportDestinations
b. Destination Org > Allow constraints/resourcemanager.allowedImportSources
Then issue this command in Cloud Shell once all the above requirements are met:
gcloud beta projects move [Project-ID] --organization [ORG-ID]
OR
gcloud beta projects move PROJECT_ID \ --organization ORGANIZATION_ID
You may also check this documentation for reference
Upvotes: 10