# Lab - Explore Transformation Advisor

## Lab - Migrating Legacy JEE apps to OpenShift

### Working with IBM Cloud Transformation Advisor

## Overview

IBM Cloud Transformation Advisor helps you access, analyze and modernize middleware based apps for deployment on OpenShift. It categorizes Java EE apps and MQ queue managers as simple, medium and complex based on migration complexity and provides guidance for modernization. Transformation Advisor is included as a web app with [IBM Cloud Pak for applications](https://www.ibm.com/cloud/cloud-pak-for-applications/get-started) and is also available to be run in [a local Docker environment](https://www.ibm.com/cloud/garage/tutorials/install-ibm-transformation-advisor-local).

Transformation Advisor analyzes the applications running on the following middleware:

**Java EE application servers**

* WebLogic Server V6.0 – V11.0
* IBM WebSphere® Application Server V7.0, or later
* Apache Tomcat V6.0 (and later)
* Java applications running in a JVM

**Messaging**

* IBM MQ V7, or later

In this short lab you'll run Transformation Advisor installed on OpenShift against the data collected from an instance of WebSphere Application Server V8.5.5 and examine the recommendations provided for a different Java EE applications. You'll then look at the artifacts generated for one those apps (the later version of the WebSphere sample app Plants By WebSphere) for deployment on a Liberty container running in Kubernetes using the migration bundle generated for this app by Transformation Advisor.

### Step 1: Launch Transformation Advisor and import data collected from  WebSphere Application Server

Transformation Advisor organizes your legacy server scans into workspaces and collections. Specific server scans are typically put into to separate collections. You'll use a completed server scan as a starting point for the lab

1. Download the server scan by right clicking on [this link](https://github.com/IBMAppModernization/app-modernization-ta-explore-lab/raw/master/ta/AppSrv01.zip) and selecting **Save Link As** from the context menu to save the file locally.
2. Access Transformation Advisor by following the URL given to you by the instructor. You will then be asked to log in with either `kube:admin` or `dragonslayer-ldap`. Select `dragonslayer-ldap` and log in using credentials provided to you by your instructor.

![dragonslayer-ldap](https://2816711705-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M1Bh2a26msY5M4vW3R9%2Fsync%2F97c8c96a9af24a6b9e20021c5c018a54e4354a3b.png?generation=1590974218518576\&alt=media)

1. Once in Transformation Advisor, click on **Add a new workspace**
2. Enter a unique name for your workspace e.g. `usernnn_ta_workspace` where `usernnn` is your assigned student ID (e.g. `user011`)
3. Click **Next** and enter a name for the collection e.g. `lab_collection`
4. Click **Let's go**
5.  At this point you have the option of downloading a data collection script for your legacy server to collect the data about all the installed applications or upload the results of a data collection script. Click **Upload data** then click **Drop or Add File** and select the file **AppSrv01.zip** you downloaded previously.

    ![Uploading data collection file](https://2816711705-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M1Bh2a26msY5M4vW3R9%2Fsync%2Fbc502af46790c50156af0dd5e5d5078cbd09acac.png?generation=1590974212499872\&alt=media)
6. Click **Upload** to upload the file
7.  You should be presented with a summary of recommendations for 4 applications running on the WebSphere Application Server instance where the data collection script was run.

    ![Recommendations summary](https://2816711705-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M1Bh2a26msY5M4vW3R9%2Fsync%2F2345d363d13e0984e46eecd5113cd65116d9875d.png?generation=1590974213622732\&alt=media)

### Step 2: Explore the report generated by Transformation advisor

1.  Lets look at the apps designated with red to indicate that changes to the app are required before running the app on WebSphere Liberty. Click on the link for the app **petstore-WAS.ear**. This is a Java EE 5 app written by the Java BluePrints program that validates several Java EE 5 features.

    ![Pet Store](https://2816711705-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M1Bh2a26msY5M4vW3R9%2Fsync%2Ff61f5a9f17aa1ee0ee93e6507a3e4558e2485c17.png?generation=1590974221580015\&alt=media)
2. Scroll down to the bottom of the page and click on **Analysis Report**. Click **OK** when prompted.
3.  The analysis will open up in a new browser tab. Scroll down to the section with title **Detailed Results by Rule** and click on **Show rule help** next to the rule named **The JSF SunRI engine was removed** to see more details about what needs to be fixed to migrate the Java Pet Store app to WebSphere Liberty running on OpenShift. Take a look at some of the other information in the report to get a feel for what type of information to expect when running Transformation Advisor against your own legacy Java EE apps.

    ![Sun JSF RI](https://2816711705-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M1Bh2a26msY5M4vW3R9%2Fsync%2Faca0409a52c6bc49e4d1babfed8f4be5e076bdde.png?generation=1590974217582267\&alt=media)
4.  Go back to the **IBM Cloud Transformation** browser tab, scroll to the top of the page, and click on **lab\_collection /** to go back to the list of apps.

    ![Recommendation link](https://2816711705-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M1Bh2a26msY5M4vW3R9%2Fsync%2Fae6a657afed87a1d14cb77df8910389a3eda0a29.png?generation=1591056306045105\&alt=media)
5. This time take a look at one of the "show stoppers" for the app **plants-by-websphere-jee5.ear** by selecting the app and then clicking on the Analysis Report link. This version of the WebSphere sample Plants by WebSphere was shipped with WebSphere Application Server V7.0. Two of the three severe issues have to do with no support for the JAX-RPC API in Liberty. Note: with the explosion of REST based APIs, technologies like JAX-RPC and SOAP/WSDL have become more or less obsolete.
6. Go back to the **IBM Cloud Transformation** browser tab, scroll to the top of the page, and click on **lab\_collection /** to go back to the list of apps.
7.  Now you'll look at the migration plan for the app **plants-by-websphere-jee6-mysql.ear**. This is the Plants By WebSphere app that comes with WebSphere Application Server 8.5.5 and has been tweaked to work with the MySQL database instead of the embedded Apache Derby database that the original uses. Note that this version uses JAX-RS (the Java API for RESTful Web Services) instead of JAX-RPC and JAX-RS is fully supported on WebSphere Liberty. Click on three dot menu button to the right of **plants-by-websphere-jee6-mysql.ear** and then select **Migration plan** as shown below

    ![Migration Plan](https://2816711705-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M1Bh2a26msY5M4vW3R9%2Fsync%2F179d16ad0d6af784d29c87edc5f27dc3208d8450.png?generation=1590974220642003\&alt=media)
8. On this page you can decide how you want to recieve the output of Transformation Advisor. You have two options for what you want included in the bundled output:
9. **Source Code:** The application code is included in the bundle so that you can make tweaks to your application before deployment.
10. **Binary:** The application binaries are included in the bundle if you want to deploy without changes to the application.&#x20;

Most applications will require some tweaks to the source code in order for it to be deployable.

With **Source Code** selected as your build type you will notice a list of files that are generated for you by Transformation Advisor to aid the migration of the app to Liberty running in Kubernetes. This includes:

* **server.xml:** WebSphere Liberty configurations&#x20;
* **pom.xml:** Maven build configuration
* **Operator resources:** Files needed to deploy an [Operator](https://www.redhat.com/en/blog/introducing-operator-framework-building-apps-kubernetes) to your Kubernetes cluster to manage your application.
* **Dockerfile:** Docker container build instructions

![Source Code Build Type](https://2816711705-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M1Bh2a26msY5M4vW3R9%2Fsync%2F8d909c4057ecbc045a6c78119247926c987576bf.png?generation=1590974214570661\&alt=media)

If you select **Binary** as your build type, you will then need to provide Application Dependencies including the **Aplication Binary** and the **MySQL driver**. These will then be added to your migration bundle along with the files mentioned above.

![Binary Build type](https://2816711705-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M1Bh2a26msY5M4vW3R9%2Fsync%2F9b4b177dc8bf2b3cffa5b63849b601279d397045.png?generation=1590974219635815\&alt=media)

Lastly, Transformation Advisor gives you the choice to either download or send your migration bundle to a git repository by selecting either of the respective **Download** or **Send to Git** buttons in the bottom right of the page.

![Bundle buttons](https://2816711705-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M1Bh2a26msY5M4vW3R9%2Fsync%2Fd719a5262b17cd49c8a1cb720cb0ea13e3e0bebd.png?generation=1590974215485605\&alt=media)

Don't worry about doing anything with this bundle right now.

## Summary

You've gone through the process of evaluating various legacy WebSphere Application Server apps for migration to a containerized version running on WebSphere Liberty in Kubernetes.
