This page describes how to upgrade Mainframe Assessment Tool.

## Limitations

- Upgrade is only supported for VM deployments (not supported for Google Kubernetes Engine
  deployments).

- Upgrade is only supported sequentially. You can upgrade only to the
  next immediate version and can't skip intermediate versions. For example,
  to upgrade from version 2.1.0 to 2.3.0, you must first upgrade to 2.2.0
  and then upgrade to 2.3.0.

## Before you begin

- Use Mainframe Assessment Tool version 2.1.0 or later. Earlier versions don't support
  upgrades.

- Complete all in-progress assessments before you start the upgrade.

  If you upgrade while an assessment is in progress, Mainframe Assessment Tool won't
  resume the assessment following the upgrade and the assessment can't be
  restarted. You must re-upload your application to restart
  the assessment. However, your previously completed assessments are preserved.
- Confirm that you have superuser privileges on the Mainframe Assessment Tool VM
  instance to complete the upgrade.

## Upgrade Mainframe Assessment Tool

To upgrade Mainframe Assessment Tool, follow these steps:

1. In the Google Cloud console, click
   ![Activate Shell Button](https://docs.cloud.google.com/static/shell/docs/images/activate_cloud_shell.svg)**Activate Cloud Shell**.

   [Go to the Google Cloud console](https://console.cloud.google.com/)
2. To connect to the Mainframe Assessment Tool VM, run the following command:

       gcloud compute ssh VM_NAME --tunnel-through-iap

   Replace <var translate="no">VM_NAME</var> with the name of the Mainframe Assessment Tool VM.
3. In the Mainframe Assessment Tool VM's command-line interface, to change your privileges
   to superuser, run the following command:

   ```bash
     sudo su
   ```
4. To download the upgrade script, run the following command:

       gcloud storage cp "gs://mainframe-ai-release/mat/VM_IMAGE_NAME/upgrade" DESTINATION_DIRECTORY

   Replace the following:
   - <var translate="no">VM_IMAGE_NAME</var>: the name of the VM image that you want to upgrade to. For example, `mainframe-assessment-2-2-0`.
   - <var translate="no">DESTINATION_DIRECTORY</var>: the directory in your Mainframe Assessment Tool VM where you want to download the upgrade script.
5. To make the script executable, run the following command:

   ```bash
   chmod +x DESTINATION_DIRECTORY/upgrade
   ```

   Replace <var translate="no">DESTINATION_DIRECTORY</var> with the directory in your
   Mainframe Assessment Tool VM
6. To start the upgrade, run the following command:

   ```bash
     DESTINATION_DIRECTORY/upgrade VERSION us-docker.pkg.dev/migrate-modernize-public/mainframe-assessment-prod
   ```

   Replace the following:
   - <var translate="no">DESTINATION_DIRECTORY</var>: the directory in your Mainframe Assessment Tool VM where you have downloaded the upgrade script.
   - <var translate="no">VERSION</var>: the Mainframe Assessment Tool version that you want to upgrade to. The version must be in `mainframe-assessment-x-y-z` format; example: `mainframe-assessment-2-2-0`.
7. To confirm the upgrade, on the **Admin \& Settings** page, refresh the page and
   check the **Version**.

## What's next

- Learn how to [configure settings for Mainframe Assessment Tool](https://docs.cloud.google.com/mainframe-assessment-tool/docs/configure-settings.md.txt).