Easily restore your project to a previous version with our new Instant One-click Backup Recovery
Hygraph
Docs

Manage your project's environments

Environments allow you to safely work on isolated instances of your project. They help you make changes to you schema and test new content structures without breaking your production systems.

Manage environmentsManage environments

#Create an environment

To create a new environment, we'll use the environment cloning flow:

Create an environmentCreate an environment

  1. Navigate to the Project Settings tab in the left-hand sidebar of your Hygraph project.
  2. Select Environments under general settings.
  3. Click on the Clone button of the Master Environment card.
  4. Fill in the form:
    • Display name: Provide a display name for your environment. This is the name that will be displayed in Hygraph.
    • Endpoint alias: This is created automatically as you type in your display name, but can be edited if you wish to. Your endpoint alias is the identifier used in the URLs of the webapp.
    • Description: This is where you can add a description for your new environment.
    • Clone with context: Checkbox that allows you to select whether you'd like to include the content from the master environment.
    • Webhooks: Checkbox that allows you to select whether you'd like to clone the project's webhooks. They will be disabled initially.

#Asset URLs change

Asset URLs will be different after a clone. Make sure to check for asset URLs stored in other places, such as source code or external systems.

Please note that, while in the past every single handle would have been updated, with the new asset system only the base URL changes on cloned environments.

With the new Hygraph Asset Management System, the following asset URL:

https://eu-west-2.graphassets.com/cm1q9b9c401cv07ut4wcgf2uj/cm2kmqsf6002a07ukg3z7sjzg

Would turn into something like this:

https://eu-west-2.graphassets.com/<new asset env id>/cm2kmqsf6002a07ukg3z7sjzg

Since the asset ID remains the same, you can simply run a search for the old asset environment ID and replace it with the new one.

#Switch environments

You must have at least two environments to be able to switch. To switch environments, click on the "forking" icon in your Hygraph project sidebar, next to your project icon. From here you can switch environments by simply clicking on one.

Switch environmentsSwitch environments

#Promote environments to master

You must have at least two environments to be able to do this. To promote an environment to master, simply click on the Promote to master link in the environment card.

Promote environment to masterPromote environment to master

You will be prompted to provide a New display name and a New API ID for the current master environment being replaced. Fill in this information then click on Promote to master.

#Delete environments

You must have at least two environments to be able to do this. To delete an environment, simply click on the Delete link in the environment card. A warning will display to make sure you did not click on the link by mistake, so you need to confirm your choice by clicking on the Delete environment button to finalize the process.

Delete environmentDelete environment