How To Control Damage While Migrating To WordPress

How To Control Damage While Migrating To WordPress

Finally, the time has come. You pack up everything, put it into a box, load it into the truck, and you are on the way to a new house. You wish it were that simple. God knows how many things broke while moving, oh, and the things that you forgot there.

Then there is a nine-year-old unwilling to break the lego house, so you have to take the whole thing as it is. How can you forget her telling you to be cautious while moving the TV around? Who knows if your new house will have the tendency to accommodate things as you intended, but what choice do you have?

At first, it does not make much sense that we are talking about moving houses, but if you think a bit, it is very much the same as migrating a website. Those boxes are the core components of your website. That lego house is a functionality that you can not compromise upon.

Lastly, the TV that you are handling carefully is the database that you never want to screw up. Same as moving house, it is very stressful, but there are obvious perks of migration. There is so much on your shoulders that it becomes stressful to migrate a website to a new platform. Y

Let’s talk about ways in which you can control damage while migrating your website to WordPress.

Steps Before WordPress Migration

No matter how good you are, who knows when things will go south? When that happens, make sure you are ready for it. Before migration, make sure to make a complete backup of database and website files so that you can recover that anytime.

Back-Up Your Site’s Files

The first thing you need to do is create a duplicate of all of the files that are associated with your website. You will need to make use of an FTP program in order to accomplish this. Once you have successfully established an FTP connection to the server hosting your website, you will need to travel to the root folder of your WordPress installation.

This folder houses all of your website’s data. It is often referred to as public_html or www. Now, select Download from the context menu of your root folder by right-clicking on it:

This will cause a copy of the contents of your root directory to be downloaded into your computer. The procedure may take some time, but it is worth waiting and then never coming back.

Backup Your WordPress Database

You should already have a copy of the files that make up your website at this point. It is now necessary for you to back up its database. This is the location where all of the information on your site’s content, users, and a great deal more is stored.

In order to accomplish this, you will need to access your database. The control panel of most web servers gives you access to these kinds of features. For instance, if you are utilizing cPanel, you will locate a component that is referred to as a Database. You will want to select the phpMyAdmin option when you get to that section.

Steps After WordPress Migration

Now that you have transferred to wordpress, you are likely to see various issues. These may include issues with links such as 404 and 405 errors and issues with plugins and themes. Let’s discuss how you are going to fix those issues. (Warning: Might get a bit nerdy)

Fix Broken URLs

You have migrated to WordPress for fancy SEO plugins, but now what, Broken links? If you are facing URL issues after migrating, we suggest updating URLs. The WordPress Command Line Interface (abbreviated as CLI) will make the process of administering your WordPress website much simpler.

You will be able to perform a search for a string of data that you provide and then replace it with another by utilizing the WP-CLI search and replace command. Let’s have a look at how you may use the WP-CLI command search-replace to change an outdated URL to a fresh one.

  • The first thing that has to be done is to connect to SSH. For those of you who are unfamiliar, SSH is a cryptographic network protocol. It is utilized to accurately conduct network services within an insecure network. SSH into your cPanel as the site owner of the website where you want the modifications to be made.
  • The next step is to use the cd command to navigate to the directory containing your website’s document root. For instance, you may type cd public_html/my website. Not that you should type in the precise path to the document root directory of your website, but you may if you like.
  • And last, make sure the next instruction is executed.
    wp search-replace “old URL” “new URL” —dry-run (optional)

Remember to update the old URL and new URL with the actual URLs of your website when you make the change. You will be able to view the findings and, if required, validate the results using the dry-run command before making any modifications to the database.

Images Not Showing Up

If you changed the website files to a different place while keeping the same domain name, the problem might be caused by the “Uploads” folder or a specific file within it, which is the identical “month file.” You may simply locate the precise folder if you use one of the plugins that detect broken links. Look at the month connected with the picture URL.

Yourwebsite.com/wp-content/uploads/2022/09/this-is-an-image.png is an example.

In this situation, you can see that the month is “09,” and you must validate that specific file. Log in to your cPanel account and then choose the File Manager icon. You now have the blog files, and you must locate the “wp-content” folder, which contains the “Uploads” folder. You may now see “every month”

It is clear that the problem is one of two things:

  • The files are corrupted or missing, and you must manually re-upload them.
  • If the file permissions are incorrect, you must pick the files one by one and click on “Change Permissions” at the top of the screen, then change them to 755 or 777 if that does not work.

Error Establishing A Database Connection

If you see this issue, the first thing you should do is return to your wp-config.php file. Check that the database name is free of errors and is spelled correctly. Furthermore, confirm that the username, password, and permission are all right.

  • Go to www.yourdomain.com/wp-admin if your database name is spelled correctly. This is what creates the problem if you encounter an error page stating that your site needs to be fixed. Locate and open your wp-config.php file to resolve the problem. Fill in the blanks with the following code:define(‘WP ALLOW REPAIR’,true);
  • Check out www.yourdomain.com/wp-admin/maint/repair.php to see whether it helped you correct the issues in your database. When you’re done, remember to remove the line from your wp-config.php file.

Lost Files

You don’t want to lose all or any of your important files in the situation that something goes wrong. Unfortunately, one of the most common problems encountered by front-end developers during WordPress conversion is the inability to locate files. This happens mostly because the ‘lost’ files are saved in unique directories specific to your host.

To fix this, we will need the backup we created initially (Told you it was necessary).

  • Navigate to your home folder in your host website’s file manager and look for the public HTML file.
  • Compress the file to a zip file and save it to your preferred location.
  • After that, go to phpMyAdmin and export your database. You may then move it to the specified storage place.

SSL Certificate Issues

If you run an eCommerce website, you must have an SSL certificate. Here’s what to do if anything goes wrong during the move.

  • If you get the NET::ERR CERT INVALID error, it is likely that you did not update the domain name in your certificate. An SSL certificate is assigned to a certain domain name, and changing it will cause it to fail. To resolve this issue, manually reinstall the certificate.
  • If you receive mixed content problems, it signifies that certain URLs on your website still refer to the HTTP version. Therefore, you must manually discover and replace them with HTTPS URLs or use a plugin like SSL Insecure Content Fixer.

That’s It From Us

As the saying goes, “the devil is in the details”. When you migrate to wordpress, you are bound to face these pitfalls. But we have tried our best to help you with the most recurring issues you face during migration. Think carefully and plan appropriately before taking a step forward.