Steps to help with downloading a copy of deployed application hosted Cloud Foundry instance.
Guide provides step by step how to:
These are useful if the original source code is no longer available to make an application update, need to update an application stack. The following example will show how to update your application stack from the deprecated Cloud Foundry stack cflinuxfs3 to cflinuxfs4 without the original source code.
Useful Cloud Foundry CLI commands:
cf login -a https://api.cf.eu1.mindsphere.io --sso
cf space-users <ORG_NAME> <SPACE_NAME>
cf target -o <ORG_NAME> -s <SPACE_NAME>
cf droplets <APP_NAME>
cf cancel-deployment <APP_NAME>
cf scale <APP_NAME> -k 1G
cf scale <APP_NAME> -m 512M
cf push <APP_NAME> --droplet <DROPLET_NAME> -s cflinuxfs4
cf restage <APP_NAME>
Users familiar with Cloud Foundry, CF CLI commands, and pushing applications.
Access to your CF org and proper CF roles assigned. E.g., Space Developer.
Cloud Foundry CLI tool v7+ installed.
https://docs.cloudfoundry.org/cf-cli/install-go-cli.html#bin
cf app <APP_NAME>
and you will see similar output:C:\> cf app <APP_NAME>
Showing health and status for app <APP_NAME> in org <ORG_NAME> / space <SPACE_NAME> as user@company.com...
name: <APP_NAME>
requested state: started
routes: appname.apps.eu1.mindsphere.io
last uploaded: Tue 12 Oct 09:16:25 PDT 2021
stack: cflinuxfs3
buildpacks:
name version detect output buildpack name
php_buildpack 4.4.41 php php
type: web
sidecars:
instances: 1/1
memory usage: 128M
state since cpu memory disk details
#0 running 2024-04-29T16:37:12Z 0.5% 28.2M of 128M 234.6M of 512M
cf create-app-manifest <APP_NAME>
and you will see similar output:
C:\> cf create-app-manifest <APP_NAME>
Creating an app manifest from current settings of app <APP_NAME> in org <ORG_NAME> / space <SPACE_NAME> as user@company.com...
Manifest file created successfully at C:\<APP_NAME>_manifest.yml
OK
<APP_NAME>_manifest.yml
cf download-droplet <APP_NAME>
and you will see similar output:C:\> cf download-droplet <APP_NAME>
Downloading current droplet for app <APP_NAME> in org <ORG_NAME> / space <SPACE_NAME> as user@scompany.com...
Droplet downloaded successfully at C:\droplet_5569e13d-3e2d-4e73-a409-ae0c0000e621.tgz
OK
droplet_5569e13d-3e2d-4e73-a409-ae0c0000e621.tgz
droplet_5569e13d-3e2d-4e73-a409-ae0c0000e621.tar
cf push <APP_NAME> --droplet <DROPLET_NAME> -s cflinuxfs4
and the output will be similar:C:\> cf push <APP_NAME> --droplet droplet_5569e13d-3e2d-4e73-a409-ae0c0000e621.tgz -s cflinuxfs4
Pushing app <APP_NAME> to org <ORG_NAME> / space <SPACE_NAME> as user@company.com...
Uploading droplet bits...
89.36 MiB / 89.36 MiB [===================================================================================] 100.00% 1m16s
Waiting for API to complete processing files...
Waiting for app <APP_NAME> to start...
Instances starting...
Instances starting...
name: <APP_NAME>
requested state: started
routes: appname.apps.eu1.mindsphere.io
last uploaded: Mon 29 Apr 11:51:33 PDT 2024
stack: cflinuxfs4
buildpacks:
name version detect output buildpack name
php_buildpack 4.6.17 php php
type: web
sidecars:
instances: 1/1
memory usage: 32M
state since cpu memory disk details
#0 running 2024-04-29T18:52:13Z 0.6% 19.2M of 32M 482.4M of 600M
cf app <APP_NAME>
to check as well.
Q: If your app fails to start after updating from cfliunxfs3 to cflinuxfs4. For example:
name: <APP_NAME>
requested state: started
routes: appname.apps.eu1.mindsphere.io
last uploaded: Mon 29 Apr 11:46:48 PDT 2024
stack:
buildpacks:
type: web
sidecars:
instances: 0/1
memory usage: 32M
state since cpu memory disk details
#0 crashed 2024-04-29T18:49:46Z 0.0% 6.9M of 32M 282.7M of 1G
Start unsuccessful
TIP: use 'cf.exe logs <APP_NAME> --recent' for more information
FAILED
A: Check the application logs with the command cf logs <APP_NAME> --recent
cf scale <APP_NAME> -k 1G
and cf scale <APP_NAME> -m 512M
to adjust the values.cf restage <APP_NAME>
command to rebuild your app with the new settings.cf droplets <APP_NAME>
can show you all available droplets. You can set the current droplet with command cf set-droplet <APP_NAME> <GUID>
cf cancel-deployment <APP_NAME>
to cancel an existing deployment.
cf app <APP_NAME> --guid
c501c1f3-4f81-4905-aaa9-b39759535fe1
cf curl /v2/apps/<GUID_FROM_STEP_2>/droplet/download --output myapp.tgz
myapp.tgz
to your current directory.