After over 15 years with my U.S. web host, I have decided to move on. Their server performance is unacceptably slow, and I thought it would improve when I upgraded to a business package. I foolishly signed for 3 years at a “good” price but regretted after realising a lot of constraints.

Anyway, I was already planning to move my Music Photo Life to a new host, and decided to go for a Singapore-based web host company (no names will be mentioned because that is not the purpose of this post). My plan went into action when all of a sudden my SSL cert in my old web host expired and I had to fork out US$35 for the first year and US$70 subsequently. No way am I going to pay that when my contract would expire in 6 months.

This current host have a few plans, and I was contemplating a basic web plan and a business plan, which runs on SSD that promised faster server response. I bit the bullet and went for the latter, and glad I did that. The plan came with free migration service, so I asked them to assess, for which they agreed, but the next available migration date was 30 days later. I was like, what was I supposed to do meanwhile? I tried to assess the cPanel but could not, but later had my password reset and managed to get in.

So I thought to myself, why not I try migrating the WordPress site myself? I have nothing to lose: if I couldn’t get it to work, I would let the new web host do it 30 days later. It would be a good opportunity to “play around”, since I have 2 working web host accounts (I will only terminate the old web host service 6 months later anyway).

After searching online, I tried a few methods, and did not work. First, there was the WP plugin called “Duplicator”, which was supposed to be the easiest. It failed on my during the process because I believe the backup size was too huge for the old web host to handle.

Second, I tried to compress my WordPress site using cPanel File Manager, and that failed to complete, also because of the size of the WP folder (over 3GB).

I then figured that I had been successfully backing up my site using Softaculous, and I have all the backup files, so why couldn’t that be used for the transfer?

So I did it. And this is how it goes.

How To Migrate WordPress to a New Host

Step 1: Backup with Softaculous

Run a backup on the site using Softaculous interface.

Step 2: Download the Backup File

Softaculous backup files are located at the softaculous_backups folder at the same level as your public_html folder. Use the cPanel File Manager and download to your local drive.

Step 3: Upload the Backup File to New Host and Extract

Upload the same file to your new host. Then extract the zipped file using the right-click context menu.

Here’s an important question: where do you want your new WordPress folder to run from? For my case, I am not changing the site name, so the process is less problematic.

Step 4: Create new SQL Database

On the cPanel, click MySQL Databases to create new database and user. Take note of the database name, user name, and password.

Step 5: Restore SQL Database

In the new WP site, look for the file softsql.sql , download the file back to your local drive. Then on the cPanel, click phpMyAdmin, select the WP database you created in step 4, then import softsql.sql by selecting the file from your local drive. Uncheck “Partial Import”.

Step 6: Modify wp-config.php

You need to update the SQL database name, user and password.

/** The name of the database for WordPress */
define('DB_NAME', 'yourdbname');
/** MySQL database username */
define('DB_USER', 'yourdbuser');
/** MySQL database password */
define('DB_PASSWORD', 'yourpassword');

Step 7: Modify DNS

DNS is domain name server which tells the web browser where to look for your site. Since I have moved my host, I need to update the DNS to the new host so that it points to the new site when visitors enter my website address. This update may take up to 48 hours which is the time taken to update all the DNS around the world. In addition, the users’ web browser should also have the cache flushed so that they can read the new DNS information instead of relying on cached data.

Step 8: If It Doesn’t Work, Check These Places

My first WP migration went well, with just one issue on the .htaccess file that was due to an invalid default script. My second WP migration hit some errors that I could not figure out. But as I studied the error_log, I googled around and found that one of the files specified the absolute folder path (i.e. \home\oldhost\public_html\wpsite\wp-content\…). I had to find that annoying file and change the values, but the error_log did not specify the source. After opening each file, I finally found the culprit: .user.ini and wordfence-waf.php. This file was used by WordFence plugin, so if you don’t use this WP plugin, then you might not encounter this issue.

After fixing that, I encountered yet another error, this time from wp-download-codes. Again, with the help of online search, I found the issue, which was due to the different PHP version on both webhosts.

If You Want To Change Your WP Site Path

My tutorial does not cover that, but it’s just a matter of changing all the path folders in the SQL database as well the above files mentioned. Your images links may also need to be amended. There are many online guides on how to do that.

Conclusion

There are also other tools to help in WordPress migration, but if all fails, try the above. It works for me, so I’m blogging this for my own reference, in case I need to migrate again 12 months later after my current contract ends.

Leave a Reply

Your e-mail address will not be published. Required fields are marked *