Links

Clone between Environments

Learn how to create a new Environment from a Deployment and how to clone Deployments between Environments.

Create a new Environment from a Deployment

Creating a new Environment from a Deployment can be very beneficial. Let's look at a simple example. You have a bug in your Production Environment that you need to fix. Your Staging Environment is already a couple of versions ahead of your Production Environment and you don't want to block the teams that are working on the next production release. You can thus just clone the Deployment in your Staging Environment that was used for the last Deployment to Production into a new Environment and test your hotfix there before updating Production.
To create a new Environment, you will need to have the Administrator role within your Organization or hold the Owner/Developer role on the App. Learn more about RBAC in Humanitec here.
You can create a new Environment from a Deployment in any other Environment from the App Details Screen.
UI
CLI
API
  1. 1.
    Click on the three dots next to the Deployment you want to clone into your new Environment.
  2. 2.
    From the Clone deployment to dropdown select + Create new environment.
  3. 3.
    Configure your new Environment via the Create new environment dialog box:
    • Environment type - allows you to select the Environment Type that should be used for the new Environment.
    • Environment name - specific the name for the new Environment following your internal standards.
  4. 4.
    Click on Create.
Step 1-2 for creating a new Environment from a Deployment
Step 3-4 for creating a new Environment from a Deployment
After hitting Create, your new Environment is created. Note, that Humanitec does not automatically trigger a Deployment to newly created Environments. So make the changes you might want to make in your new Environment and then hit the Deploy button to run your first Deployment in the new Environment.
Always deploy all clones at least once before deleting the source environment. Otherwise, drafts containing these clones will be deleted together with the environment.
Note, that in the Deployment history on the left-hand side you can see which Environment (and Deployment) your new Environment was cloned from.
Our CLI is currently in closed beta. Please contact us if you want to learn more.
A new environment can be created from an existing Deployment via the Add a new Environment endpoint.

Clone a Deployment to an existing Environment

To clone a deployment, you will need to have the Administrator role within your Organization or hold the Owner/Developer role on the App. Learn more about RBAC in Humanitec here.
You can clone a Deployment to an existing Environment from the App Details Screen.
UI
CLI
API
  1. 1.
    Click on the three dots next to the Deployment you want to clone into another Environment.
  2. 2.
    From the Clone deployment to dropdown select the target Environment you want to clone to.
  3. 3.
    From the Clone deployment to dialog box select the Workloads you would like to clone into the priorly selected target environment:
    • Click on Select all to clone the entire Deployment or
    • Select individual Workloads from the list to clone a subset of Workloads.
  4. 4.
    Click on the Clone workloads button.
Step 1-2 of cloning a deployment to an existing Environment
Step 3-4 of cloning a deployment to an existing Environment
Note, that Humanitec does not automatically trigger a Deployment of the clone in the target environment. So make the changes you might want to make and then hit the Deploy button to deploy the clone.
Always deploy all clones at least once before deleting the source environment. Otherwise, drafts containing these clones will be deleted together with the environment.
Note, that in the Deployment history on the left-hand side you can see which Environment (and Deployment) your new Environment was cloned from.
Our CLI is currently in closed beta. Please contact us if you want to learn more.
Deployments can be cloned to an existing environment via the Rebase to a different Deployment endpoint.