I have mentioned in my previous blogs that this website is hosted on one of the Tencent cloud vm, with both the website service and database running on the same host. I didn’t actually take serious backup and DR solutions for the host, just taking the snapshot before I do any major upgrade, for either the host image or the WordPress platform.
I realised with surprise yesterday that rent of this vm is going to expire by next February and the extending fee by one year is about 10 times (1,000+ CNY) of what I payed for the vm originally. Then I noticed some discount events by Tencent of purchasing new hosts. A domestic vm host with the basic configurations (RAM and bandwidth) only costs 79 CNY and I can extend the rent by another year with the same price. This is more attractive than extending my existing vm host. So I ordered another vm host. But the next question is if the existing host is going to be recycled by Tencent, what I am going to do with it, mainly how I should handle the website and data on this host?
Before answering the question, I notice something else I need to take care, upgrading both WordPress and the host as I notice there are some major versions between my current WordPress version and the latest and also some security and patches need to be installed for the host. So, upgrade those first!
The upgrades are not complicated and they are completed without any issue, at least during the upgrade process, but when I try to visit the website after the host is rebooted, I get the error “Error with the database connection”. That is not great. I was thinking maybe I need to roll back everything with the snapshot as there are some major versions between my previous ones and the latest which can break something with my configurations. I was almost starting to do the roll back before the service is back to normal with the website functioning normally. Phew! Maybe just the database service was lazy and late to get started. Cool, now I only need to figure out the solution for the migration.
What I am thinking is instead of pure migration, transferring everything to another host and then shutting down this host completely before it’s recycled, maybe I can try the load-balance which is something I always want to introduce to my home infra. If I can get that setup, both this host and the new host will be able to server the request to the website and even this host is shutdown and removed, the website will still be functioning. Ok, I will try this way. Fortunately, I still have 4 months to test and prove whether it works or not.