The last few days felt like weeks as I was migrating out of Hostgator. Back in 2014 when I first used their service, I had to upgrade to a Virtual Private Server (VPS) just to do unlimited email blasts. It was getting rather expensive at RM16,000 for 3 years subscription, and RM1000 for cPanel 3 year subscription.

For being a loyal customer and upgrading to a VPS, they gave me discount at RM12,000 for 3 years, but there was a discount glitch, so I still had to pay RM16,000 and I get 3 years and 8 months, essentially paying forward.

Renewed at 2017 and now in 2023, I’ve finally found a viable alternative hosting. Cut the long story short, the new hosting will only charge RM1600@year!

And so the migration begun, but the problems has only begun.

File transfer was a headache. Then I learned I could zip them and uncompressed them after uploading to the server. This way I don’t have to download upload 60000 files, but just one.

Most of my scripts are in one folder, but settings between a VPS and a shared server are different, thus the root file path went bonkers and I almost gave up until i found the solution on the ever helpful stack overflow!

define('APP_ROOT', realpath($_SERVER["DOCUMENT_ROOT"]));

I learned that WordPress runs CRON everytime a user visits the website. It helps check for scheduled post or minor maintainance, but with enough visits, it can overload the server. So by disabling the cron and set the server to run it at interval instead, this will reduce the server load when there’s high traffic.

define('DISABLE_WP_CRON', true);

Last but not least was PHP errors. I’ve been living under a rock because for the longest time I was playing guesswork on what script is giving problem, be it not declaring variables or assigning a numeric value to string. That’s when I found this to display all errors.

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);