Skip to main content
U.S. flag

An official website of the United States government

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Cloning applications

Say you have an existing deployment on Cloud Foundry, and you want to make a new staging environment. Below are the different scenarios around application manifests.

If you have a single manifest

  1. Run cf push <NEW_APP_NAME> .
  2. Use the CLI to do any other necessary configuration.

If you have environment-specific manifests

  1. Use manifest inheritance to do any necessary configuration.
  2. Run cf push <NEW_APP_NAME> -f <PATH_TO_MANIFEST> .
  3. Make sure to run any necessary database setup commands, etc.

If you don’t have a manifest

  1. Generate a manifest from an existing application:

    cf target -o <EXISTING_APP_ORG> -s <EXISTING_APP_SPACE>
    cf create-app-manifest <EXISTING_APP_NAME>
    cp <EXISTING_APP_NAME>_manifest.yml <NEW_APP_NAME>_manifest.yml
  2. Clean up <NEW_APP_NAME>_manifest.yml . You probably only need the following properties:

    • name  (required) – make sure to change it to the new app name
    • env  – change any environment-specific variables, e.g. the DATABASE_URL 
    • services 
  3. Deploy the new environment:

    cf push <NEW_APP_NAME> -f <NEW_APP_NAME>_manifest.yml
  4. Make sure to run any necessary database setup commands, etc. for the new application.