Moving a Firebase project to a GCP Organization

Neil Kolban
Google Cloud - Community
5 min readNov 6, 2021

Recently, I was working with a client who had created a Google Firebase project and had been using it successfully. They then realized that the creation of a Firebase project resulted in the creation of a corresponding GCP project and this GCP project was not owned by a GCP organization and hence not properly within the realm of their environment. They wanted to know how to migrate the Firebase/GCP project to exist inside their desired GCP organization.

This article describes a recipe that can be used to achieve the task. In this recipe we will be working with a number of parts so let’s look at them now.

We will start with the Firebase environment.

I created the Firebase project by clicking the “Add project” button/card. At this point also note that I am authenticated as my “Firebase” developer user. In this example that is a gmail account called kolbandev@gmail.com. I called my project “my-firebase-project”.

After a few minutes, the project was created. I can now visit the Project Overview menu at the top left and select the project settings:

This shows some interesting information about our Firebase project:

The one that I particularly want you to pay attention to is “Project ID”. In this example, it has the value “my-firebase-project-861d6”. What this is is the underlying GCP project. Let us now login to the GCP Console using our Firebase email (kolbandev@gmail.com in this example).

When we arrive there, we will see a GCP project called “my-firebase-project” with the Project ID that we expected. We can select that project as the project against which we wish to work.

If we compare this information to the Firebase details, we will see that they match and we are indeed working with the correct GCP project. At this point we have our base story. We have a Firebase project that manifests as a GCP project. However, this Firebase project does not (in this case) live within my desired GCP organization. Our goal now is to move this project to its correct location.

Let us now consider the correct location. In this example, I have a GCP organization called kolban.altostrat.org. When done, I want this Firebase GCP project to exist under that organization. To achieve this goal, I need to select a Google account that has authority to create new projects in my target organization. The identity I selected was kolban@kolban.altostrat.org. We now need to give this identity permission in the Firebase/GCP project to be able to perform the move.

While authenticated as the Firebase identity (kolbandev@gmail.com), go to the IAM page of the GCP project called my-firebase-project:

Click the ADD button to add some new permissions on the project. We wish to add two roles. One is called “Project Mover” and the other is called “Project IAM Admin”. We wish to add these to the organization user that has permissions to create projects in the organization (kolban@kolban.altostrat.com in this example).

The result will be:

We have now performed the setup required for our migration. We will now open a new browser window and login into the GCP Console as our GCP organization user (kolban@kolban.altostrat.com in this example).

If all has gone well, you should be able to select from NO ORGANIZATION and see the firebase project. Remember, at this time you are the GCP organization user. Click on the 3 vertical dots at the top right and go to Project settings:

There you will find:

and now we are getting close to the conclusion. Notice the MIGRATE button at the top. Click that button.

You will now be able to select the target organization to which you wish to migrate the project. Select the correct organization and click MIGRATE. A popup will briefly appear telling you that the migration has been completed. If we now review the projects within the organization, we will find that the project is now present:

What remains is for you to validate that all resources have migrated successfully and review which billing account is associated with the project and change as necessary.

References

--

--

Neil Kolban
Google Cloud - Community

IT specialist with 30+ years industry experience. I am also a Google Customer Engineer assisting users to get the most out of Google Cloud Platform.