US flag signifying that this is a United States Federal Government website An official website of the United States government

Moving apps between spaces

Moving apps between spaces

If you have an app that exists in one org/space but you need to move it to another:

  1. Deploy the new application instance using the appropriate steps on the cloning page.
    • Make sure to run cf target -o <NEW_ORG> -s <NEW_SPACE> before running cf push.
    • If you keep the app name the same, you may need to use a different host to avoid route conflicts.
  2. Go back to the old space.

    cf target -o <OLD_ORG> -s <OLD_SPACE>
  3. If you are changing orgs, remove the domain/route.

    cf delete-domain <DOMAIN>
    # or
    cf delete-route <SHARED_DOMAIN> -n <HOST>
  4. Go back to the new space.

    cf target -o <NEW_ORG> -s <NEW_SPACE>
  5. If you changed orgs and are using a Domain, re-create it.

    cf create-domain <DOMAIN>
  6. Map the domain/route.

    cf map-route <APP_NAME> <DELEGATED_DOMAIN>
    # or
    cf map-route <APP_NAME> <SHARED_DOMAIN> -n <HOST>
  7. Delete the old app.

    cf target -o <OLD_ORG> -s <OLD_SPACE>
    cf delete <APP_NAME>