A rich community of developers, various features, and countless plugins have shaped WordPress into a home of 30% of all websites. The platform is extremely easy to navigate and allows you to build all kinds of websites. So, there is no wonder many businesses and individuals choose to power their websites using WordPress.
In some cases, you may need to migrate your WordPress website from one server to another. Moving your website can involve some trial and error, but it doesn’t have to. Knowing what causes the most common issues and how to solve them makes the migration process nothing to be concerned about. The website migration process implies exporting your database and importing it to the new host, moving all of your files, and creating some configurations.
To ease your migration (and in case you’ve run into a problem), we’ve gathered a list of the five most common errors during WordPress migration and different ways to fix them.
Before we continue…
Losing your website’s file is always devastating. That’s why you want to make sure to back up your website before making any changes. This will prevent your files from getting lost along the way as you migrate your website.
1. Error Establishing a Database Connection
Error Establishing a Database Connection is one of the most common and daunting errors a WordPress user can encounter when migrating their website. This error occurs when your website no longer communicates or has access to your database.
How to fix the error establishing a database connection?
If you’ve encountered this error, the first thing you should do is go back to your wp-config.php file. Make sure that the database name doesn’t have any typos and is spelled correctly. Besides, ensure the username, password, and permission are also correct.
If your database name is spelled correctly, go to www.yourdomain.com/wp-admin. If you see the error page telling you that your site needs to be repaired, this is what causes the issue. To fix the error, locate and open your wp-config.php file. Type in the following line of code:
Go to www.yourdomain.com/wp-admin/maint/repair.php and check whether this helped you to fix the errors in your database. When you’re finished, make sure to delete the line from your wp-config.php file.
Read more about Error establishing database connection
2. 500 internal server error
The Internal Server Error can pop up as a result of plugin incompatibility. Also, the 500 Error may occur if your new host has invalid file permissions.
How to fix the 500 internal server error?
One way to solve the 500 Internal Server Error is by allowing the host to access your files. You can do it in the permissions folder.
If your file permissions look fine, go to your .htaccess file, try renaming it, and then reload your website. If this didn’t help either, generate a new .htaccess file and reload your website.
Still getting the 500 Error? Delete the .htaccess file you’ve just created and restore the old version. Go to the PHP settings and increase your memory limit.
If this method didn’t work as well, your plugins may be causing the issue. Now, try deactivating all WordPress plugins and then activate them one by one to see which one causes the error.
3.Problems with URLs in posts
It’s common for URLs in posts to stop working as a result of migration. This happens because the URLs in your posts are likely leading to your previous domain.
How to fix problems with URLs in posts?
If the URLs in your posts don’t work, try running the following SQL query into your database:
UPDATE wp_options SET option_value = replace(option_value, ‘http://olddomain.com’, ‘http://newdomain.com’) WHERE option_name = ‘home’ OR option_name = ‘siteurl’;
UPDATE wp_posts SET guid = replace(guid, ‘http://olddomain.com’,’http://newdomain.com’);
UPDATE wp_posts SET post_content = replace(post_content, ‘http://olddomain.com’, ‘http://newdomain.com’);
UPDATE wp_postmeta SET meta_value = replace(meta_value, ‘http://olddomain.com’, ‘http://newdomain.com’);
4. Invalid SSL Certificate Error
If you didn’t change the domain name in your SSL certificate, there is a great chance that you can receive the NET::ERR_CERT_INVALID error.
How to fix the invalid SSL certificate error?
The problem with SSL certificates is that they are given to specific domain names. Simply changing the name is not going to work. What you can do is reinstalling the SSL certificate manually to fix the issue.
Sometimes, website migration can result in increased downtime. This happens when you have moved all of your files to the new host but the URLs are leading your website visitors to the old hosting. The users will get the 404 error since the links lead straight to nowhere.
How to reduce the downtime during the WordPress migration?
One way to reduce the downtime is by using an internal address that many hosts have. This way, you can ensure the constant uptime during the website migration.
Also, an experienced custom coursework writing services specialist advises сhanging the host’s file on your computer. Locate the host’s file and run it in Notepad as an admin. Now, go to your new host’s cPanel and locate the Shared IP Address. Add a new line to the host’s file and type in the very same IP address you’ve located. Now, add your domain name, so that it looks like this:
Once you’ve finished the migration process, don’t forget to delete this line from your file.
Errors during WordPress migration are not rare. So, keep calm and don’t panic if you’ve encountered one error or another.
The good news is that someone had already run into the very same problems and found the ways to fix them. If you tried the methods and none of them worked, don’t hesitate to contact the support.