Migration Toolkit for Applications 7.3

Visual Studio Code Extension Guide

Using the Migration Toolkit for Applications extension for Visual Studio Code to identify and resolve migration issues.

Red Hat Customer Content Services

Abstract

You can use the Migration Toolkit for Applications extension for Visual Studio Code to accelerate large-scale application modernization efforts across hybrid cloud environments on Red Hat OpenShift. You can analyze your applications and identify and resolve issues to prepare these applications for a successful migration.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. We are beginning with these four terms: master, slave, blacklist, and whitelist. Because of the enormity of this endeavor, these changes will be implemented gradually over several upcoming releases. For more details, see our CTO Chris Wright’s message.

Chapter 1. Introduction to the MTA extension for Microsoft Visual Code

You can migrate and modernize applications by using the Migration Toolkit for Applications (MTA) extension for Microsoft Visual Studio Code.

The MTA extension can perform the following actions:

  • Analyze your projects with customizable rulesets.
  • Mark issues in the source code.
  • Provide guidance to fix the issues.
  • Perform automatic code replacement, if possible.

The MTA extension is also compatible with Visual Studio Codespaces, the Microsoft cloud-hosted development environment.

Chapter 2. Installing the MTA extension for Visual Studio Code

You can install the MTA extension for Visual Studio Code (VS Code).

Prerequisites

  • You installed the Java Development Kit (JDK). MTA supports the following JDKs:

    • Oracle JDK 17 or later.
    • Eclipse Temurin™ JDK 17 or later.
    • OpenJDK 17 or later.
  • You have 8 GB of RAM available.
  • For macOS installation, you have the value of maxproc set to 2048 or greater.

Procedure

  1. Set the JAVA_HOME environmental variable:

    $ export JAVA_HOME=jdk11
  2. In VS Code, click the Extensions icon on the Activity bar to open the Extensions view.
  3. Enter Migration Toolkit for Applications in the Search field.
  4. Select the Migration Toolkit for Applications extension and click Install.

    The MTA extension icon ( MTA code extension ) is displayed on the Activity bar.

Chapter 3. Configuring the .kantra directory

Starting from Migration Toolkit for Applications (MTA) 7.2.0, you can perform an application analysis in the containerless mode. Before running the analysis, you must create and configure the .kantra directory.

Prerequisites

Procedure

  1. Create a directory named .kantra in your $HOME directory:

    $ mkdir ~/.kantra/
  2. Move all the files from the extracted MTA directory, except the mta-cli binary, into the ~/.kantra directory.

    $ mv !(mta-cli) ~/.kantra/

Verification

Chapter 4. MTA Visual Studio Code extension interface

The interface of the Migration Toolkit for Applications (MTA) extension for Visual Studio Code is designed to make it easier for you to find information and perform the required actions:

  • In the left pane, you can see the Analysis Results directory tree that includes the following elements:

    • A report icon. You can click the icon to open the MTA report in your browser.
    • The applications analyzed by MTA.
    • The rulesets used for the analysis.
    • The issues discovered by the analysis.
  • In the upper right pane, you can configure an analysis.
  • In the lower right pane, you can see the settings of the configuration, including source, target, and advanced options. You can view the progress of an analysis in this pane. When the analysis is completed, you can click the Open Report button to open the MTA report, which describes any issues you need to address before you migrate or modernize your application. For more information, see Reviewing an analysis report.

Chapter 5. Configuring and running an application analysis

To analyze an application with the MTA extension for Visual Studio Code, you must create a run configuration first. You can configure multiple run configurations to run against each project you import to Visual Studio Code.

Prerequisites

  • You installed the mta-cli executable. You can download mta-cli from the MTA download page.

Procedure

  1. In Extensions view, click the Migration Toolkit for Applications icon ( MTA code extension ) on the Activity bar.
  2. Click the plus sign (+) next to Migration Toolkit for Applications to add a run configuration.
  3. Specify the following configuration fields:

    • Name: Enter a name for the analysis configuration or accept the default suggestion.
    • cli: Enter the path to the mta-cli executable, for example: $HOME/mta-cli-7.3.1.GA-redhat/bin/mta-cli.
    • Input: Set to the path of the project that you have open within your IDE:

      1. Click Add.
      2. Perform one of the following actions:

        • Enter the input file or directory and press Enter.
        • Click Open File Explorer and select the directory.
    • Target: Select one or more target migration paths.
  4. Right-click the run configuration and select Run.

    When the analysis is completed, you can click the Open Report button to open the MTA report, which describes the issues you need to address before you migrate or modernize your application. For more information, see Reviewing an analysis report.

Chapter 6. Reviewing and resolving migration issues

You can use the MTA extension icons to prioritize issues based on their severity.

Procedure

  1. Select a run configuration directory on the left pane.
  2. Expand its folders to view the Hints generated for each application file.
  3. Select a hint to view the source code.
  4. Right-click a hint and select View Details to view the Rule ID and other information.
  5. Prioritize issues based on the following icons, which are displayed next to each hint:

    • Mandatory : You must fix the issue for a successful migration.
    • Warning : You might need to address the issue during the migration.
  6. Resolve issues by editing the code of a file with a hint:

    1. In the left pane, right-click an issue and select Open Code.
    2. Make any changes needed to the code and save the file.
    3. Optional: Right-click the issue and select Mark as Complete or Delete.

Legal Notice

Copyright © 2025 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.