WordPress Migrator

A tool for admins to migrate WordPress projects from Plesk / cPanel. All the necessary automation scripts are stored at the dedicated WordPress Import Add-On repository at GitHub.

Note: The functionality is applicable for standalone projects and unsuitable for clusters.

Prerequisites

Note: Ensure you have admin SSH access to the remote hosting (Plesk or cPanel) because the migrator requires wp-toolkit CLI.

You need to ensure that the following preconditions are fulfilled before starting the migration:

Migrator Environment

Log into the developer’s dashboard (not the default WordPress one) as the platform admin user by the following link:

1
https://app.{platformDomain}

1. Click the Import button at the top-left corner of the dashboard.

import button

2. Provide a URL (at the appropriate tab) to the manifest file that will create a dedicated environment for handling the migration operations:

1
https://github.com/jelastic-jps/wordpress-import-addon/blob/master/manifest.yml

import URL manifest

Click Import to proceed.

3. Within the opened dialog, you can provide Environment and Display names and choose a Region (if available) where it will be installed.

WordPress migrator installation

4. Click Install once more and wait a minute for the environment to be created.

WordPress migrator environment

This environment can handle all the needed migration operations. No need to create new environments even if you plan multiple migrations.

User Account

Ensure that the target end-user is registered and has prepared the appropriate subscription(s). For example, the user experience can be the following:

1. Register at the Virtuozzo Application Platform for WordPress to try the platform and compare functionality/pricing with the existing solution.

2. If satisfied with the results, confirm the migration with an admin.

3. Depending on the size and preferred topology for the migrated projects, you can select the suitable subscription by following the project installation guide. The number of instances in each subscription can be set through the Websites field.

Tips:

  • If you want to get an empty subscription without any projects inside, exit the installer after purchasing the subscription (the fifth step of the linked guide).
  • If you already have a subscription (e.g., obtained during the platforms comparison), it can be used for the migration - just remove any unnecessary testing projects.

get WordPress subscription

4. Go to the account settings (Your Account > Subscriptions section) and verify that you have a space for all migrated projects. For better results, it is recommended to analyze your project size and resource demands to create subscriptions of a suitable capacity. For example, in the image below, you can see two separate subscriptions prepared:

check account subscriptions

5. When ready, let the admin know and provide the following details:

  • which projects from Plesk / cPanel should be migrated, and to which subscription
  • SSH access credentials to your remote hosting account (host, port, user name, password)

Note: Currently, cPanel has a problem with the Panopticon utility not loading the environmental paths needed to locate the related binary locations.

If working with cPanel, verify the problem by executing the following command:

1
wp-toolkit --wp-cli -instance-id 1 -- db check

If you get an error, you need to set the isCpanelPanopticonEnabled parameter as false in the wp-toolkit configuration file (/usr/local/cpanel/3rdparty/wp-toolkit/var/etc/config.ini).

Migration Process

Once set up, the admin user can start the migration.

1. Go to the migrator repository at GitHub and copy the content of the addon.jps file.

copy add-on code

2. Return to the dashboard and click the Import button at the top-left corner. Paste the code from the previous step to the JPS tab of the opened window.

import JPS add-on

3. Edit variables in the Change Variables section as follows:

  • targetUID – ID of a user where environments with migrated projects will be installed
  • envName – migrator environment name (installed during the pre-configuration)
  • ssh_host – IP address of the remote host for connecting via SSH
  • ssh_port – port of the remote host for connecting via SSH
  • ssh_user – user name for connecting to the remote platform via SSH
  • ssh_pass – password for connecting to the remote platform via SSH

change add-on variables

Click Import when ready.

4. In a moment, all projects will be loaded from the remote hosting, and you’ll see the following window:

  • Target User ID – the ID of a target user specified in the previous step (email address will be displayed for additional verification)
  • Subscription – a list of the target user subscriptions; choose one for the migrated project(s)
  • Display projects – filter to display all projects from the remote hosting (All projects) or for the specific user only (Projects by Source User ID)
    • Source User ID – additional field to choose a remote user
  • Projects – a list of projects loaded from the remote hosting, select projects that should be migrated (if all are displayed, you’ll see a prefix with remote user ID)

configure projects migration add-on

Tip: On successive migrations the previously used projects will be highlighted according to the status:

migrated pojects

Click Install to start the migration.

5. The add-on creates an environment for each project under the user account, using the same PHP version as on the remote hosting. After environment(s) creation, the add-on connects to the remote host, makes database dump and restores it locally, then copies all content via rsync. Lastly, it updates database connection string, substitutes URLs (site and home), and clears all the caches.

Please be patient, as the process may take a while depending on the network bandwidth and project size. After the migration, the admin will recieve the dashboard notification and an email report.

migration results dashboard

migration results email

6. You can click Open in Browser for the migrator environment to view a dedicated page with all the migrations performed with the current environment.

migrator open in browser

migration results HTML

Each project has a separate record with three possible statuses:

  • Success – environment creation and WordPress project migration are completed successfully
  • Error – environment creation failed (you’ll see the appropriate error message)
  • Failed – environment was created successfully, but migration has failed
  • In Progress – projects that are currently being migrated
Tip: Failed environments will be automatically removed from the user account. Try migrating them once again in case it was some temporary error.

7. That’s all! You can notify the customer of the migration result.

Note: Remind the user to manually check any custom configurations (e.g., “hardcoded” hostnames or paths) to ensure the correct operability of the migrated projects.

What’s next?