Create a copy or clone of an application running on PCF
search cancel

Create a copy or clone of an application running on PCF

book

Article ID: 297444

calendar_today

Updated On:

Products

VMware Tanzu Application Service for VMs

Issue/Introduction

If I have an existing application running on Pivotal Cloud Foundry, how can I copy or clone that application and run it as its own separate application?

Resolution

There are currently two options to when cloning an application.

1. Use cf local and cf push --droplet (Preferred) - https://pivotal.io/cf-local 

  • cf local along with cf push --droplet allows an operator to download an applications droplet and re-upload that same source code as a new staged application. 
    • cf install-plugin cflocal
    • cf local pull testApp
    • cf push testAppCopy --droplet testApp.droplet
Note: If a you do not wish to download a plugin, users can download the Droplet manually with curl:
cf curl /v2/apps/$(cf app <APP> --guid)/droplet/download --output ./droplet.tgz
  • cf copy-source requires an already deployed application and then copies the contents of the source application over to the new target application.
  • The target application will be restarted but it does not get staged:
cf copy-source SOURCE_APP TARGET_APP [-s TARGET_SPACE [-o TARGET_ORG]] [--no-restart]