MuleSoft Technical Guides

Mule Migration Assistant

User MuleSoft Integration Team
Calendar September 15, 2021

Mule Migration Assistant is an open-source tool for accelerating the conversion process
from Mule 3 to Mule 4 application. Due to the complexities in the conversion process, MMA
will not be able to convert 100 percent of the applications, and manual intervention is required to attain a fully functional Mule 4 application. The tool doesn’t fall under MuleSoft
commercial offerings with the Anypoint Platform, and hence there is no support on it from
MuleSoft.

MMA is entirely free, open, modifiable, and redistributable, and you can download the tool
from MuleSoft’s GitHub repository.

MuleSoft Migration Assistant is run from a Command-Line that takes the Mule 3 application
and converts it into a Mule 4 application along with a conversion report that notes any of the
errors that occurred during the conversion process. Mule Migration Assistant will convert:
● Flows and their inner logic
● Global configurations
● Global elements
● DW1 scripts to DW 2 scripts.
● MEL Scripts to DW 2 scripts.
● MUnit Tests.
● API Gateway Policies
● Connectors, Transports, and Modules

Note that all connectors/modules/transport are currently supported. You may visit
docs.mulesoft.com for the formal documentation on MMA.

In this blog, we will take a deeper dive into migration with MMA tool. We will take an example of a Mule 3 application and walk through its functionality. Further steps will explain putting that application into MMA to get a Mule 4 App, analyzing the conversion report generated, and working on errors and warnings to a point where it has a fully functional Mule 4 application.

Steps to migrate Mule 3 to Mule 4 Using MMA:

Step 1: Download MMA

To download MMA tool, refer to link below:

https://github.com/mulesoft/mule-migration-assistant/blob/master/docs/user-docs/migration-tutorial.adoc

Step 2: Create a Mule 3 App in Anypoint Studio 6 Version

Below is sample Mule 3 application which consist of various components and DataWeave 1 scripts :

Mule 3 Application

Step 3: Migration using MMA Tool

projectBasePath: Mule 3 application path

destinationProjectBasePath:  Mule 4 application path where you want it to migrate.

Command for migration: In a command console you need to run the following command with set projectBasePath and destinationProjectBasePath.

java -jar mule-migration-assistant-runner-1.0.0.jar -muleVersion 4.3.0 -projectBasePath C:/Users/user/AnypointStudio/workspace/demo-mule3-project -destinationProjectBasePath

C:/Users/user/AnypointStudio/workspace/migrated4

Same command is used for both Windows and Mac OS.

Mule Migration Command Line

The Mule 3 application successfully migrated to Mule4 in 2.898 seconds.

Import your Mule 4 application in Anypoint Studio 7 Version and a summary report is generated which is important that it contains errors, warnings and info.

MMA Migration Summary

Error: Aspects of the Mule 3 apps which have no direct conversion to Mule 4 apps and need to be manually re-written.

Warnings: Aspects of the Mule 3 apps that have similar translation in Mule 4.

Info: Aspects of the Mule 3 apps that have been slightly modified with no major functionality change.

Step 4: Manual Migration in Mule 4 Application based on Summary Report

Import your migrated application in Anypoint Studio 7 Version and below is application before manual migration.

Mule 4 app

Manual Migration may involves following steps:

  • Delete the http status codexml snippet as below
  • Delete the Attributes to inbound properties as we do not need it
  • Delete the Outbound properties as we do not need it
  • Update the flowVars to vars.

After Manual Migration:

Mule 4 app migrated

 

Winding Up: 

MMA is a great tool to save up a tremendous amount of time and effort and is constantly evolving. The developers can access the source code to modify and improve it to best suit their needs and accelerate the migration efforts. You can visit the MuleSoft repository hub and make pull requests and contribute to the project. By complying with the guidelines, MuleSoft will make changes/additions after the review process.

 

 

Leave a comment

Your email address will not be published. Required fields are marked *