Once a GCP project has been associated with an IAM Organization, there is no way to move the project out of the organization (on your own). However, this can be accomplished with the help of Google Enterprise Support.
Process
- Create a list of projects that you’d like to move.
- Move all the projects out of any folders in the current organization and into the top level.
- Contact Support with a list of projects that you’d like to move from the current organization to another organization.
- Support will move the projects out of the current organization so they have no parent (no organization).
- Move all the projects into the new organization.
Example
Create a list of projects:
bash$ cat > projects.txt << EOF
project-1
project-2
project-3
EOF
Get the organization ID of the current org (ex. mydomain.com):
bash$ gcloud organizations list | grep '^mydomain.com'
mydomain.com 123456789012 C00123456
Move projects to top level of the organization:
bash$ for project in `cat projects.txt`; do
gcloud alpha projects move $project --organization 123456789012
done
Contact Google support about moving your project out of the organization.
Once Google support has confirmed your projects have been moved out of the organization, then you can move them into the new organization.
Get the organization ID of the new org (ex. mynewdomain.com):
bash$ gcloud organizations list | grep '^mynewdomain.com'
mynewdomain.com 987654321098 C00987654
Move projects into new org:
bash$ for project in `cat projects.txt`; do
gcloud alpha projects move $project --organization 987654321098
done
Now, all of the projects in projects.txt
will be in the new organization!