Overview

When moving WordPress websites either between hosting environments (eg from a different provider to Conetix) or between URL’s (eg if your business name and domain name have changed), there are a number of changes required to be made to your WordPress database for this to work as expected.

We can use the latest feature of the WP Toolkit to access the WordPress CLI to run a search and replace on the WordPress database to update these requirements for you.

Warning: The changes below may irreversibly break your WordPress website if not followed correctly. Please ensure you have a database backup before proceeding.

If you don’t make these changes, you may see errors relating to open_basedir restriction in your error logs .

Instructions

  1. Login into Plesk via the Conetix Control Panel.
  2. Go to the WordPress site you need to run the updates for.
  3. Within the WP Toolkit, select the WP-CLI option:
    wp toolkit: wp-cli search and replace
  4. Type search into the command bar and select search-replace as the option:
    wp toolkit: wp-cli search and replace
    (This will display the help for the search-replace command)
  5. If you’ve moved hosting environments (eg, cPanel to Conetix), you will need to look for any options targeting the old path. For example:
    --dry-run /home/username/public_html /var/www/vhosts/yourwebsitepath
  6. Click the Run button to start:
    wp toolkit: wp-cli search and replace
  7. This should give a list of tables in your WordPress database and how many entries may need to be changed:
    wp toolkit: wp-cli search and replace
    (--dry-run means it won’t actually make the changes, just list where they would be made)
  8. If you’ve moved domains / URL’s, you will need to search for the old URL to replace with the new URL. For example:
    --dry-run --skip-columns=guid https://oldwebsite.com https://newwebsite.com
  9. Click the Run button to start:
    wp toolkit: wp-cli search and replace
  10. Once you’re confident the required changes will be applicable, you can remove the --dry-run to make the actual changes to the database (make sure you have a backup first!).
  11. After the changes are made, load the website and ensure you can still login. Check your website error logs for any other error messages as well.

Was this article helpful?

Related Articles