Chapter 3. Installing MTA command-line interface
You can install the Migration Toolkit for Applications (MTA) command-line interface (CLI) on Linux, Windows, or macOS operating systems.
You can also install the CLI for use with Docker on Windows. Note, however, that this is a Developer Preview feature only.
3.1. Installing the CLI by using a .zip file Copy linkLink copied to clipboard!
You can install the Migration Toolkit for Applications (MTA) command-line interface (CLI) by using the downloadable .zip file available on the official MTA download page.
Prerequisites
Red Hat Container Registry Authentication for
registry.redhat.io. Red Hat distributes container images fromregistry.redhat.io, which requires authentication. For more details, see Red Hat Container Registry Authentication.NoteThis prerequisite is not applicable for the containerless mode. For more information, see Analyzing applications in containerless mode.
- You installed Java Development Kit (JDK) version 17 or later.
-
You set the
JAVA_HOMEenvironmental variable. -
You installed Maven version 3.9.9 or later with its binary added to the
$PATHvariable.
Procedure
Navigate to the MTA download page and download one of the following operating system-specific CLI files or the
srcfile:- mta-7.3.2-cli-linux-amd64.zip
- mta-7.3.2-cli-linux-arm64.zip
- mta-7.3.2-cli-darwin-amd64.zip
- mta-7.3.2-cli-darwin-arm64.zip
- mta-7.3.2-cli-windows-amd64.zip
- mta-7.3.2-cli-windows-arm64.zip
- mta-7.3.2-cli-src.zip
-
Extract the
.zipfile to the.kantradirectory inside your$HOMEdirectory. The.zipfile extracts themta-clibinary, along with other required directories and files. Move the
mta-clibinary to your$PATHvariable.NoteYou can place the
mta-clibinary in any folder that is included in the$PATHvariable. Alternatively, you can add a folder that containsmta-clito$PATH. This way, you do not need to specify a full path when using the CLI.
3.2. Installing the CLI on a disconnected environment Copy linkLink copied to clipboard!
When your system is in a disconnected environment, you can install the Migration Toolkit for Applications (MTA) command-line interface (CLI) by performing the following actions:
- Download the required images by using an external computer.
- Copying the downloaded images to the system you want to install MTA CLI on.
The following procedure applies only to container mode.
The analysis output in the disconnected environment usually results in fewer incidents because a dependency analysis does not run accurately without access to Maven.
Prerequisites
- You downloaded the required MTA CLI binary from the Migration Toolkit for Applications Red Hat Developer page.
- You installed the Podman tool on your system.
For the analysis of Java applications, you enabled container runtime usage by setting the
--run-localflag tofalse:--run-local=falseThe analysis of non-Java applications runs in container mode by default.
Procedure
On a connected device, perform the following steps:
Authenticate to registry.redhat.io:
$ podman login registry.redhat.ioRun the
mta-clibinary file. The binary file pulls the required provider images. For example:$ mta-cli analyzeImportantThis command only pulls the required images. For example, if you run a command that requires Java images, a .NET image will not be pulled.
Display the image list:
$ podman images REPOSITORY TAG IMAGE ID CREATED SIZE registry.redhat.io/mta/mta-generic-external-provider-rhel9 7.3.1 8b8d7fa14570 13 days ago 692 MB registry.redhat.io/mta/mta-cli-rhel9 7.3.1 45422a12d936 13 days ago 1.6 GB registry.redhat.io/mta/mta-java-external-provider-rhel9 7.3.1 4d6d0912a38b 13 days ago 715 MB registry.redhat.io/mta/mta-dotnet-external-provider-rhel9 7.3.1 66ec9fc51408 13 days ago 1.27 GBSave the images:
$ podman save <image_ID> -o <image_name>.image- Copy the images onto a USB drive or directly to the file system of the disconnected device.
On the disconnected device, enter:
$ podman load --input <image_name>.image
3.3. Installing the CLI for use with Docker on Windows Copy linkLink copied to clipboard!
To migrate applications built with .NET framework version 4.5 or later, on Microsoft Windows to cross-platform .NET 8.0, you must install the CLI for use with Docker on Windows. To do so, you must configure Docker to use Windows containers first.
Prerequisites
- A host with Windows 11+ 64-bit version 21H2 or higher.
- You downloaded the Docker Desktop for Windows installation program. For more details, see Install Docker Desktop on Windows.
Procedure
- Open a PowerShell with Administrator privileges.
Ensure Hyper-V is installed and enabled:
PS C:\Users\<user_name>> Enable-WindowsOptionalFeature -Online ` -FeatureName Microsoft-Hyper-V-AllPS C:\Users\<user_name>> Enable-WindowsOptionalFeature -Online ` -FeatureName ContainersNoteYou might need to reboot Windows for the change to take effect.
Install Docker Desktop on Windows.
Run the installer by double-clicking the
Docker_Desktop_Installer.exefile.By default, Docker Desktop is installed to the
C:\Program Files\Docker\Dockerpath.Ensure that Docker will run Windows containers as the backend instead of Linux containers:
- In the Windows task bar, right-click on the Docker icon.
- Click Switch to Windows containers.
In PowerShell, create a folder for MTA:
PS C:\Users\<user_name>> mkdir C:\Users\<user_name>\MTAExtract the
mta-7.3.2-cli-windows.zipfile to theMTAfolder:PS C:\Users\<user_name>> cd C:\Users\<user_name>\DownloadsPS C:\Users\<user_name>> Expand-Archive ` -Path "{ProductShortNameLower}-{ProductVersion}-cli-windows.zip" ` -DestinationPath "C:\Users\<user_name>\MTA"Ensure that Docker is running Windows containers the
OS/Archis set towindows/amd64:PS C:\Users\<user_name>> docker versionClient: Version: 27.0.3 API version: 1.46 Go version: go1.21.11 Git commit: 7d4bcd8 Built: Sat Jun 29 00:03:32 2024 OS/Arch: windows/amd64 Context: desktop-windows Server: Docker Desktop 4.32.0 (157355) Engine: Version: 27.0.3 API version: 1.46 (minimum version 1.24) Go version: go1.21.11 Git commit: 662f78c Built: Sat Jun 29 00:02:13 2024 OS/Arch: windows/amd64 Experimental: falseSet the
CONTAINER_TOOLenvironment variable to use Docker:PS C:\Users\<user_name>> $env:CONTAINER_TOOL="C:\Windows\system32\docker.exe"Set the
DOTNET_PROVIDER_IMGenvironment variable to use the upstreamdotnet-external-provider:PS C:\Users\<user_name>> $env:DOTNET_PROVIDER_IMG="quay.io/konveyor/dotnet-external-provider:v0.5.0"Set the
RUNNER_IMGenvironment variable to use the upstream image:PS C:\Users\<user_name>> $env:RUNNER_IMG="quay.io/konveyor/kantra:v0.5.0"