Customize migration plan for WordPress sites

You should review the migration plan file that resulted from creating a migration. Customize the file before executing the migration. The details of your migration plan are used to extract the workload container artifacts from the source.

This section describes the contents of the migration and the kinds of customizations you might consider before you execute the migration and generate deployment artifacts.

Before you begin

  • Ensure that you've already created a migration and have the migration plan file.

  • If your WordPress site relies on a database connection, then ensure that the database is accessible from the target cluster as Migrate to Containers doesn't automatically migrate it.

Edit the migration plan

After you have copied the file system and analyzed it, you can find the migration plan in the new directory that is created in the specified output path: ANALYSIS_OUTPUT_PATH/config.yaml.

Edit the migration plan as necessary and save the changes.

Review your migration plan details and guiding comments to add information as needed. Specifically, consider edits around the following sections.

Migration plan structure

The migration plan for a WordPress workload has the following structure, which you can customize as described in the following sections.

sites:
- # Image name. Edit this to change the artifacts naming.
  imageName: wordpress
  # Parent WordPress image for the generated container image.
  fromImage: wordpress:6.1-php7.4-apache
  # WordPress root directory.
  rootDirectory: /var/www/html/
  # Database connection values.
  databaseValues:
  - name: DB_NAME
    value: database_name_here
  - name: DB_USER
    value: username_here
  - name: DB_PASSWORD
    value: password_here
  - name: DB_HOST
    value: host_here

To add information as needed, review your migration plan details and guiding comments.

Specifically, consider edits around the following sections.

Specify the Docker image

In the migration plan, generate a Docker community image tag based on the WordPress version.

If you want to change the Docker community image, or provide your own docker image, you can modify the fromImage tag in your migration plan using the following format:

# Parent WordPress image for the generated container image.
  fromImage: wordpress:6.1-php7.4-apache

Specify the database connection configuration

The databaseValues section contains the database connection configuration extracted from the VM. Modify these values to change the database connection.

These values are passed to the migrated pod.

Data migration plan structure

The data migration plan for a WordPress workload has the following structure:

volumes:
- deploymentPvcName: wordpress-pvc
  folders:
  - /var/www/html/wp-content
  newPvc:
    spec:
      accessModes:
      - ReadWriteOnce
      resources:
        requests:
          storage: 10G

The uploaded content, plugins, and themes that reside in the wp-content folder in your WordPress VM are exported to a persistent volume claim (PVC). The PVC is attached and mounted to the migrated pod.

What's next