How to fix errors after migrating WordPress?

 

Migrations from cPanel-based servers are usually seamless. But sometimes, a few issues might occur, mostly configuration-related, due to the difference in server configuration between your old hosting provider and us. Fixing them is relatively easy.

 

Check Your Website


After migrating a website, you need to do the following to access the site from our server:

  • Change the nameservers of your domain.

    Or, change the DNS records so the domain resolves to our servers.

  • Install an SSL Certificate.

 

While the DNS is propagating, you can check the website using a free VPN or web proxy:

Web Proxy: https://hide.me/en/proxy

You can also view your website without changing the nameservers or DNS.

Accessing your website using its actual URL, not the temporary URL, is vital. Your website may appear broken when accessed using a temporary URL due to the difference in the URL.

 

Check PHP Version


Check if you are using the correct PHP version and extensions:

  • Go to cPanel > Select PHP Version.

    If you used a different PHP version on the old server, change the PHP version.

    You can enable/disable PHP extensions from the same interface.


  • If the PHP version is correct, reset the PHP extensions to default from cPanel > Select PHP Version > Reset to Default.

Check your website after applying any solution. Make sure to clear your browser cache before checking. Sometimes, websites can be cached in public caches or outside of your device. You can use a web proxy or free VPN to bypass those caches.

 

Disable Incorrect PHP Handler


One of the common errors is using an incorrect PHP handler in the [.htaccess] and [.user.ini] files.

Disable any PHP handler and check your website.

 

Correct Plugin File Path in .Htaccess


Some security and caching plugins insert their file paths in the .htaccess file. If your old hosting server uses a different directory structure than ours, this might cause an error.

NinjaFirewall and Wordfence WAF embed file paths in the .htaccess and .user.ini files.

  1. Go to cPanel > File Manager > Navigate to the [public_html] directory.

    If you do not see the [.htaccess] file, click "Settings" (top right corner) and checkmark "Show Hidden Files (dotfiles)".


  2. Right-click on .htaccess > Edit.

  3. Find the following code blocks:

    php_value auto_prepend_file "/home/customer/www/yourdomain.com/public_html/wp-content/nfwlog/ninjafirewall.php"

    And

    php_value auto_prepend_file '/home/customer/www/yourdomain.com/public_html/wordfence-waf.php'

    Note:
    The actual file path in your file might be different.
    You might have double quotes instead of single quotes.
    You might only have a single code block and not both.

    *Move on to the next solution if your file does not have the code block.


  4. Correct the file path.

    Replace the following part:

    /home/customer/www/yourdomain.com/public_html/ninjafirewall.php

    With:

    /home/yourcpanelusername/public_html/ninjafirewall.php

    *Replace yourcpanelusername with the actual username of your hosting account with us.

    Hint:
    Go to cPanel > Domains and hover your mouse over the home icon (under Document Root) next to your domain name to view the correct path.

    If you have multiple domains/subdomains in your hosting account, your actual path might differ from the above.


  5. Repeat the above steps for the .user.ini file.

    *Your website might not have a [.user.ini] file. Not all websites have it.

  6. Done!

 

Reset .Htaccess File


The configuration files store PHP and website configuration. If your old hosting server uses a different configuration than our server, this difference can trigger errors on your website.

Reset the .htaccess file and check if it solves the error.

Move on to the next solution if the login page displays an error.

 

Check Basic Configuration


  • If you are using any CDN, purge the CDN cache.

    If the server IP is tied to the CDN, you might need to update the server IP in your CDN settings. You can view your server shared IP on the right sidebar of your cPanel.

  • If you are using additional features from a CDN, it might take some time for the CDN to complete a resync.


  • Disable Object Cache.

    If you are using an object cache like Redis or Memcached, disable it.

    You might need to purge the cache directory after disabling the object cache.


  • If you are using any security plugins such as a firewall, anti-malware, etc., disable them.

  • Disable Caching Plugins.

  • Purge LiteSpeed Cache.

 

The steps above should fix some common errors you might get after a migration. Sometimes, some files got corrupted during the migration. In that case, you might need to migrate the site again.

 

  • 372 Users Found This Useful
Was this answer helpful?

Related Articles

How to fix the 403 forbidden error in WordPress?

In this article, we will show you how to easily fix the 403 forbidden error in WordPress. What...

How to reset or regenerate the .htaccess file in WordPress?

A [.htaccess] file is a configuration file that tells your server how to handle certain things on...

How to deactivate plugins when not able to access WordPress admin?

Often during troubleshooting, you may need to deactivate all plugins and activate them one by...

WordPress Error - Your PHP installation appears to be missing the MySQL extension which is required by WordPress

  The most common reason for the error is using an invalid PHP handler/directive in the...