The migrate_legacy_wordpress_to_modern_wordpress Script

Valid for versions 82 through the latest version

Version:

82


Last modified: July 28, 2021

Overview

The /usr/local/cpanel/scripts/migrate_legacy_wordpress_to_modern_wordpress script converts legacy cPAddon WordPress® installations to use the RPM-based WordPress cPAddon. When you run this script, the system creates a log file in the /var/cpanel/logs/migrate_legacy_wordpress_to_modern_wordpress directory.

Important:
  • This script is only available to the root user.
  • This script is only available on systems with the cPAddon WordPress installed.

The script performs the following actions for each specified WordPress installation:

  1. Scans the cPanel account’s home directory for the cPanel::Blogs::WordPress.yaml file.
  2. Verifies that the WordPress version is greater than 3.7.
  3. Removes the cpaddons-site-software WordPress plugin.
  4. Updates the WordPress installation to use the RPM-based WordPress cPAddon.

Run the script

To run this script on the command line, use the following format:

/usr/local/cpanel/scripts/migrate_legacy_wordpress_to_modern_wordpress [--user] [--instance] [options]

User and installation options

Use the following options to target the installations to convert:

Option
Description Example
--all Required.
Convert all legacy cPAddon WordPress installations to the RPM-based WordPress cPAddon.
Note:
You cannot call both the --all and --user options.
--all
--user Required.
Convert all legacy cPAddon WordPress installations for a cPanel account to the RPM-based WordPress cPAddon.
Note:
  • You cannot call both the --all and --user options.
  • Use this option multiple times for more than one account.
--user username
--instance Convert a legacy cPAddon WordPress installation for the specified cPanel account instance to the RPM-based WordPress cPAddon. The instance file resides in the cPanel account’s home directory.
Note:
  • This option requires the user option.
  • This option only accepts a single cPanel account. You cannot call this option with multiple user options.
  • Use this option multiple times for more than one instance file for a cPanel account.
--instance /home/username/.cpaddons/cPanel::Blogs::WordPress.1.yaml

Other options

This script also accepts the following options:

Option Description Example
--no-color Remove the colorized script output. --no-color
--dryrun Only report information about the currently installed legacy WordPress installations. --dryrun
--help Display the script’s help documentation. --help
--verbose Return additional information in the script’s output. --verbose

Examples

To convert all legacy WordPress sites on the server, run the following command:

/usr/local/cpanel/scripts/migrate_legacy_wordpress_to_modern_wordpress --all

To convert all the legacy WordPress sites for the username cPanel account, run the following command:

/usr/local/cpanel/scripts/migrate_legacy_wordpress_to_modern_wordpress --user username

To convert all the legacy WordPress sites for the username, username1, and username2 cPanel accounts, run the following command:

/usr/local/cpanel/scripts/migrate_legacy_wordpress_to_modern_wordpress --user username --user username1 --user username2

To convert a specific legacy WordPress site for the username cPanel account, run the following command:

/usr/local/cpanel/scripts/migrate_legacy_wordpress_to_modern_wordpress --user username --instance /home/username/.cpaddons/cPanel::Blogs::WordPress.1.yaml

To convert multiple legacy WordPress sites for the username cPanel account, run the following command:

/usr/local/cpanel/scripts/migrate_legacy_wordpress_to_modern_wordpress --user username --instance /home/username/.cpaddons/cPanel::Blogs::WordPress.1.yaml --instance /home/username/.cpaddons/cPanel::Blogs::WordPress.2.yaml

Additional Documentation