Migrating Apps to PAS for Windows
This topic describes the process of migrating apps running on PAS for Windows 2012R2 cells to run on PAS for Windows cells, which run Windows Server 2016.
Pivotal recommends you use the blue-green deployment method for high availability. For more information about blue-green deployments, see Using Blue-Green Deployment to Reduce Downtime and Risk.
To install and deploy the PAS for Windows tile, follow steps 1 and 2 of Installing and Configuring PAS for Windows.
Perform the following steps to redeploy a running app with zero downtime using the blue-green method:
cf loginto log in to the Cloud Foundry Command Line Interface (cf CLI).
Choose your org and space.
Navigate to the location of your app.
cf appsto find the name of the app, ORIGINAL_APP_NAME, that you are migrating from PAS for Windows 2012R2 to PAS for Windows. Create a new name for the app to replace it. Pivotal recommends you append
-greento your app name, APP_NAME-green.
cf pushto push the renamed app APP_NAME-green, passing in
$ cf push APP_NAME-green -s windows2016 -b BUILDPACK -n HOSTNAME --no-start --no-route
- For BUILDPACK, enter your custom buildpack by name or Git URL with an optional branch or tag.
- For HOSTNAME, enter the subdomain name you are pushing to.
-s windows2016runs the app in a Windows Server 2016-based cell.
--no-startcreates the instance VMs but does not start the app.
--no-routeprevents the push command from automatically mapping a route to the app.
- For more command options, see cf push.
Switch the router so all incoming requests go to ORIGINAL_APP_NAME and APP_NAME-green using the cf map-route command. The command requires you enter your domain name after the app name. For example,
$ cf map-route APP_NAME-green DOMAIN -n HOSTNAME
Start the green app.
$ cf start APP_NAME-green
cf appsto confirm that both your ORIGINAL_APP_NAME and APP_NAME-green are running. If you experience a problem, see Troubleshooting Application Deployment and Health.
Unmap the original app’s route by running the cf unmap-route command.
$ cf unmap-route ORIGINAL_APP_NAME DOMAIN -n HOSTNAME
To delete the ORIGINAL_APP_NAME, run the cf delete command. To also delete any mapped routes, run the command with the
$ cf delete ORIGINAL_APP_NAME -r
Once you have migrated all of your apps and you are no longer using the Windows 2012R2 tile, a PCF operator can perform the following steps:
From the Installation Dashboard, click the trash icon on the tile to remove that product. In the Delete Product dialog box that appears, click Confirm.
In the Pending Changes view, click Apply Changes.
After you delete a product, the product tile is removed from the installation and the Installation Dashboard. However, the product appears in the Available Products view.