You can upgrade the Migration Toolkit for Containers (MTC) by installing the latest Migration Toolkit for Containers Operator.

You must ensure that the same Operator version is installed on the source and target clusters.

Do not enable automatic updates on the OpenShift Container Platform 4.5 cluster.

If you are upgrading MTC 1.3, you must perform an additional procedure to update the MigPlan custom resource (CR).

Upgrading the Migration Toolkit for Containers on an OpenShift Container Platform 4 cluster

You can upgrade the Migration Toolkit for Containers (MTC) on an OpenShift Container Platform 4 cluster using the OpenShift Container Platform console.

Procedure
  1. In the OpenShift Container Platform console, navigate to OperatorsInstalled Operators.

  2. Click Migration Toolkit for Containers Operator.

  3. Under Provided APIs, locate the Migration Controller tile, and click Create Instance.

  4. Click Create.

  5. Click WorkloadsPods to verify that the MTC pods are running.

Upgrading the Migration Toolkit for Containers on an OpenShift Container Platform 3 cluster

You can upgrade Migration Toolkit for Containers (MTC) on an OpenShift Container Platform 3 cluster by downloading the latest operator.yml file and replacing the existing Migration Toolkit for Containers Operator.

Prerequisites
  • Access to registry.redhat.io

  • Podman installed

Procedure
  1. Log in to registry.redhat.io with your Red Hat Customer Portal credentials:

    $ sudo podman login registry.redhat.io
  2. Download the latest operator.yml file:

    $ sudo podman cp $(sudo podman create registry.redhat.io/rhmtc/openshift-migration-rhel7-operator:v1.4.2):/operator.yml ./
  3. Replace the Migration Toolkit for Containers Operator:

    $ oc replace --force -f operator.yml
  4. If you are upgrading MTC 1.1.2 or earlier versions, delete the Restic pods to apply the changes:

    $ oc delete pod <restic_pod>
  5. If you are upgrading MTC 1.2 or later versions, scale the migration-operator deployment to 0 to stop the deployment:

    $ oc scale -n openshift-migration --replicas=0 deployment/migration-operator
  6. Scale the migration-operator deployment to 1 to start the deployment and apply the changes:

    $ oc scale -n openshift-migration --replicas=1 deployment/migration-operator
  7. Verify that the migration-operator was upgraded to 1.4.2:

    $ oc -o yaml -n openshift-migration get deployment/migration-operator | grep image: | awk -F ":" '{ print $NF }'
  8. Download the latest controller-3.yml file:

    $ sudo podman cp $(sudo podman create registry.redhat.io/rhmtc/openshift-migration-rhel7-operator:v1.4.2):/controller-3.yml ./
  9. Create the migration-controller object:

    $ oc create -f controller-3.yml
  10. If your OpenShift Container Platform version is 3.10 or earlier, set the security context constraint of the migration-controller service account to anyuid to enable direct image migration and direct volume migration:

    $ oc adm policy add-scc-to-user anyuid -z migration-controller -n openshift-migration
  11. Verify that the MTC pods are running:

    $ oc get pods -n openshift-migration
  12. If you have already added your OpenShift Container Platform 3 source cluster to the MTC console, you must update the service account token because the upgrade deletes and restores the openshift-migration namespace:

    1. Obtain the service account token:

      $ oc sa get-token migration-controller -n openshift-migration
    2. In the MTC console, click Clusters, click the Options menu kebab next to the source cluster, and select Edit.

    3. Enter the new service account token in the Service account token field, click Update cluster, and then click Close.

Upgrading MTC 1.3

If you are upgrading Migration Toolkit for Containers (MTC) version 1.3.x, you must manually update the indirectImageMigration and indirectVolumeMigration parameters in the MigPlan custom resource (CR).

Because the indirectImageMigration and indirectVolumeMigration parameters do not exist in version 1.3, their default value in version 1.4 is false, which means that direct image migration and direct volume migration are enabled. Because the direct migration requirements are not fulfilled, the migration plan cannot reach a Ready state unless these parameter values are changed to true.

Prerequisites
  • You must have upgraded MTC from version 1.3.x to 1.4.

  • You must have cluster-admin privileges.

Procedure
  1. Log in to the target cluster.

  2. Get the MigPlan CR:

    $ oc get migplan <migplan> -o yaml -n openshift-migration
  3. Change the following parameter values to true and save the file:

    ...
    spec:
      indirectImageMigration: true
      indirectVolumeMigration: true
  4. Apply the changes:

    $ oc replace -f <migplan>.yaml -n openshift-migration
  5. Verify the changes by viewing the updated MigPlan CR:

    $ oc get migplan <migplan> -o yaml -n openshift-migration