A project created on Fireadmin can contain multiples environments which represent multiple versions of your project. The environment names usually correspond with the state of the application within that environment (i.e. prod for a production environment and stage for a staging environment). In this case each environment is associated with a separate Firebase project.

Before Starting

  1. Make sure you have multiple projects created on Firebase to represent your multiple environment. We will be running an action to move data between them.
  2. Get a service a service account for each Firebase project you will be adding to Fireadmin. To get a service account navigate to the Service Accounts tab in the Firebase Console “project settings” page. Then click Generate New Private Key at the bottom of the Service Accounts tab. Your service account will be downloaded as a JSON file — rename the downloaded files in a way that makes it easy to tell a difference (i.e. service-account-prod.json).

Creating a Project

  1. Create a project by clicking the add tile — we will use the name firething (Note: remember that projects on Fireadmin usually contain multiple Firebase projects)

image

Adding Environments

  1. Go to Environments page by clicking Go To Environments or by clicking Environments in the project sidebar
  2. Begin adding a new environment by clicking Add Environment
  3. You can name the first environment whatever you want, but I usually go with Production or Prod
  4. Fill in the databaseURL of your project (from the Firebase console)
  5. Feel free to add a description of the environment (not necessary)
  6. Upload the service account JSON file associated with that environment
  7. Click Create
  8. Repeat steps 4–7 again for another environment (I usually name the second one Staging).

image

Running An Action

Now that we have environments setup, they are ready to be used in Actions (common logic such as copying/moving data). Lets start by searching through the existing action templates.

  1. Go to the Project Actions page by clicking Actions in the Sidebar
  2. Start searching for the action template named Copy Database Collection
  3. Click on the name — this loads the the action template (named Copy RTDB Collection) into the Action Runner
  4. Select the Source Environment (where data is being copied from)
  5. Select the Destination Environment (where data is being copied to)
  6. Input a path to copy
  7. Click Run Action

Running An Action

For information on how to create your own action template, checkout the custom action template guide