Insights Hub Download a copy of your application hosted in Cloud Foundry instance

2024-03-29T22:43:36.000-0400
Developer Tools

Summary

Steps to help with downloading a copy of deployed application hosted Cloud Foundry instance.


Details

How to download a copy of your application hosted in Cloud Foundry and generate a manifest file. This can be useful if your app needs an update, but the original source code is no longer available to push an update. Since the app is already running, you can download a copy which will have the source code.

 

Prerequisites:

Access to your CF org and proper roles assigned.

Cloud Foundry CLI tool installed.

 

Note: Replace <your_app_name> with your app.

Method 1:

  1. Sign in to your CF org and space which has the running app you want to copy.
  2. Use the following CF command: cf download-droplet <your_app_name>
  3. This will download a copy of the app droplet to your current directory. The file will be similar:
    droplet_ba4c6d36-a9e6-4571-b37e-d5083c11cec1.tgz
  4. Extract the file and you will see another compressed file. The file will be similar:
    droplet_ba4c6d36-a9e6-4571-b37e-d5083c11cec1.tar
  5. Extract this file and you should see multiple folders. The source code should be in the app folder.

 

Method 2:

  1. Sign in to your CF org and space which has the running app you want to copy.
  2. Use the command cf app <your_app_name> --guid
  3. The app guid will display: c501c1f3-4f81-4905-aaa9-b39759535fe1
  4. Use the command: cf curl /v2/apps/<guid_from_step_2>/droplet/download --output myapp.tgz
  5. This will save a compressed file called myapp.tgz to your current directory.
  6. Extract the file myapp.tgz
  7. Rename and add a .tar extension to the extracted file
    Original: myapp
    New: myapp.tar
  8. Extract this file and you should see multiple folders. The source code should be in the app folder.

 

Generating a manifest file:

  1. Be in the org and space the app you want a manifest file from.
  2. Use command cf create-app-manifest <your_app_name>
  3. You will see output like:
    Creating an app manifest from current settings of app <your_app_name> in org <your_org> / space <your_space> as user@company.com...
    Manifest file created successfully at <your_app_name>_manifest.yml
  4. The file will be in your current directory.

 

KB Article ID# KB000130921_EN_US

Contents

SummaryDetails

Associated Components

Cloud Foundry Developer Tools - Other