Migrating Apps to PAS for Windows

This topic describes the process of migrating apps running on Pivotal Application Service (PAS) for Windows 2012 R2 cells to run on PAS for Windows v2.4 cells, which run Windows Server version 1803.

Note: PAS for Windows 2012 R2 has reached its End of Availability (EoA) and is no longer generally available. For more information about upgrading the PASW tile, see Migrating from PASW 2012 R2 to PASW.

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.

Step 1: Install and Deploy PAS for Windows Tile

To install and deploy the PAS for Windows tile, follow steps 1 and 2 of Installing and Configuring PASW.

Step 2: Push App to PAS for Windows Cells

Perform the following steps to redeploy a running app with zero downtime using the blue-green method:

  1. To log in to the Cloud Foundry Command Line Interface (cf CLI), run the following command:

    cf login
    
  2. Choose your org and space.

  3. Navigate to the location of your app.

  4. To find the name of the existing PAS for Windows 2012 R2 app you are migrating to PAS for Windows, run the following command:

    cf apps
    
  5. Create a name for the replacement PAS for Windows app. Pivotal recommends you append -green to your existing app name, using the following format:

    APP-NAME-green
    

    Where APP-NAME is the existing PAS for Windows 2012 R2 app’s name.

  6. To push your app to a PAS for Windows Diego cell, using your newly created name, run the following command:

    cf push APP-NAME-GREEN -s windows -b BUILDPACK -n HOSTNAME --no-start --no-route
    

    Where:

    • APP-NAME-GREEN is the newly created “green” name for your app.
    • BUILDPACK is your custom buildpack. Specify the buildpack either by name or GitHub URL with an optional branch or tag.
    • HOSTNAME is the name of your app’s subdomain. For example, if example.com is your domain and you want the URL to your app to be http://my-app.example.com, then specify my-app as the HOSTNAME.

    For example:

    C:\Users\admin\> cf push ExampleApp-green -s windows ^
    -b https://github.com/cloudfoundry/binary-buildpack.git ^
    -n my-app --no-start --no-route
    

    Note: The --no-start and --no-route parameters included in this cf push command are required for the this procedure: --no-start is used to create the instance VMs and not start the app, and --no-route is used to prevent the push command from automatically mapping a route to the app. For additional information about cf push, see cf push.

  7. To configure the router so all incoming requests go to both APP-NAME and APP-NAME-green run the following command:

    cf map-route APP-NAME-green DOMAIN -n HOSTNAME
    

    Where:

    • APP-NAME-green is the name of the new “green” version of your app.
    • DOMAIN is your domain name, for example, example.com.
    • HOSTNAME is the name of your app’s subdomain. For example, if example.com is your domain and you want the URL to your app to be http://my-app.example.com, then specify my-app as the HOSTNAME.

    Note: When using the cf map-route command, you must specify domain name after specifying app name.

    For additional information about cf map-route, see cf map-route.

  8. To start the green app, run the following command:

    cf start APP-NAME-green
    

    Where APP-NAME-green is the name of the new “green” version of your app.

  9. To confirm that both your APP-NAME and APP-NAME-green apps are running, run the following command:

    cf apps
    

    If you experience a problem, see Troubleshooting Application Deployment and Health.

  10. To unmap the original app’s route, run the following command:

    cf unmap-route APP-NAME DOMAIN -n HOSTNAME
    

    Where:

    • APP-NAME is the name of the existing version of your app you want to replace with APP-NAME-green.
    • DOMAIN is your domain name, for example, example.com.
    • HOSTNAME is the name of your app’s subdomain. For example, if example.com is your domain and the existing app is currently accessed using the URL http://my-app.example.com, then specify my-app as the HOSTNAME.

    For additional information about cf-unmap-route, see cf unmap-route.

Step 3: Delete App from Windows 2012 R2 Server Cells

  1. To delete the original app, run the following command:

    cf delete APP-NAME
    

    Where APP-NAME is the name of the app that you have replaced with APP-NAME-green.

    Note: To also delete any mapped routes, run the command with the -r flag.

    For additional information about cf delete, see cf delete.

Step 4: (Optional) Uninstall Old Tile

Once you have migrated all of your apps and you are no longer using the Windows 2012 R2 tile, a PCF operator can perform the following steps:

  1. 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.
  2. Click Review Pending Changes.
  3. Select the PAS for Windows tile and review the changes. For more information, see Reviewing Pending Product Changes.
  4. Click Apply Changes.

    Note: 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.