WebSphere Application Server & Liberty

Getting Down to the Details of Application Migration

By Alex Motley posted 5 days ago

So, you’re ready to migrate your application to a new environment, be it Liberty, a newer Java SE version, or a newer version of WebSphere traditional? However, you aren’t sure what changes you might need to make to your application for it to run. That’s where the analysis report of the Migration Toolkit for Application Binaries (binary scanner) can help.

Generating the Detailed Migration Analysis Report

When creating the detailed migration analysis report, the binary scanner scans your application binaries against a number of rules based on your migration scenario to help you understand what updates might be required to get your application working. To generate the report:

1.     Download the binary scanner from here
2.     Unpack the binary scanner using java -jar binaryAppScannerInstaller.jar
3.     Run the unpacked jar on your application java -jar binaryAppScanner.jar SampleApplication.ear --analyze

By default, the binary scanner produces a report for an application moving from WebSphere 8.5.5 running Java SE 6 going to WebSphere Liberty running Java 8. If your migration scenario is different, you can specify different values for the --sourceAppServer, --targetAppServer, --sourceJava, and --targetJava options. A full list of the supported migration scenarios can be found by using the java -jar binaryAppScanner.jar --help analyze command.

In my case, I have an application that is currently running on WebSphere 8.5.5 that I want to move to Liberty and run with Java 11, so my command is:

java -jar binaryAppScanner.jar /path/to/guide-rest-intro.war --analyze --targetJava=java11.

What’s in the Analysis Report?

Image of a Detailed Migration Analysis Report.

The report that is produced gives details about what potential issues were flagged for your application binaries. For each flagged result, the report provides a detailed description of the potential problem, how to address it, and lists all affected files along with the match criteria, the method name if applicable, and the line number if available. Line numbers are only available for results that occur within a method body.  The rules are given severities based on how likely it is an than application will need to be updated: severe rules indicate breaking changes that will require updates, warning rules indicate behavior changes that might break an application and need to be evaluated, and info rules indicate the use of deprecated APIs or minor behavior changes that will not affect most applications.

In my case, there is one severe rule flagged related to the migration from WebSphere traditional to Liberty and one warning rule related to the migration from Java SE 8 to Java SE 11.
Image Detailed Migration Analysis Report Rule Details showing one severe rule and one warning rule.

For the severe rule it looks like I am using a WebSphere proprietary API to get the server name. The rule help provides me with an alternative I can use on Liberty and tells me where I need to update my code!
Severe detailed analysis rule

For the warning rule it looks like the format of the Java version String has changed in Java SE 11. This might or might not break an application and after looking at how I was using the version string for my application I determined that I didn’t need to make any updates.
Detailed Migration Analysis warning rule

One helpful piece of information that is included at the bottom of the analysis report is a list of all the rules that the application was analyzed for. This can be helpful to see what rules your application was scanned for but for which we didn't find any match criteria.
Detailed Migration Analysis Report list of rules analyzed section.

fter making these recommended changes, I know I'm one step further on my journey to modernizing my application. The insights provided by the binary scanner analysis report are the same as those provided by Transformation Advisor, Liberty readiness in the WebSphere Admin Console, and the WebSphere Application Migration Toolkit (source scanner) – so there are many ways to scan your applications! 
For more details on the other reports produced by the binary scanner, check out the blogs on the technology evaluation report, the inventory report, and the generated configuration.
Try the binary scanner today and let us know in the comments if you have any questions or feedback - we are always trying to make the migration process easier!