Execute a migration

You begin migrating VMs with a command that generates migration artifacts using the processing cluster you created in Installing Migrate to Containers.

To execute a migration and generate the migration artifacts:

  1. Execute the migration:

    migctl migration generate-artifacts my-migration
  2. Get the migration status:

    migctl migration status my-migration

When the status shows that the operation has completed, review the generated artifacts.

Migrating an app from a source VM creates a set of files, referred to as migration artifacts, that you use to deploy your migrated workload. After you've finished migrating a workload, review the migration artifacts used for deployment.

The migration artifacts are located in a Cloud Storage bucket. Included in the bucket are the following files:

  • Dockerfile.twas and Dockerfile.openliberty: The Dockerfile.twas and Dockerfile.openliberty files used to build the image for your migrated app.

  • build.sh: The script to build container images for the migrated applications, using gcloud builds.

  • deployment_spec.yaml: The YAML file used to deploy the workload image created by build.sh. You can use kubectl apply with this file to deploy the workload to a cluster, such as a production or test cluster. This file also includes any port mappings required by the app.

  • For each app in the VM, the following is generated:

    • An .ear file containing the application binary.

    • A .py Python script used to build the app container.

To view the generated artifact:

  1. Use the following command to download the generated artifact files:

    migctl migration get-artifacts my-migration

    This command downloads the following files that you use to deploy the migrated app: Dockerfile.twas, Dockerfile.openliberty, build.sh, and deployment_spec.yaml.

    The next section, Building an app container image, describes how to build the app container.

  2. You can also view and download these files from the Google Cloud console:

    1. Open the Cloud Storage browser in the Google Cloud console:

      Open the Cloud Storage browser

    2. Select the bucket used for migration.

    3. For the migrated app, you see the .ear and .py files.

    4. You can also see the Dockerfile.twas, Dockerfile.openliberty, build.sh, and deployment_spec.yaml files along with all other artifacts.

    5. Select a file to view its contents or download the file.

Next steps

Build a container image