Voltage
July 2, 2023, 8:01 a.m.
A comprehensive Guide to website migration: Moving to a New Hosting Company.
Introduction.
No matter how popular and recommended they could be, certain host providers could not be meant for you. If you have some DevOps experience, you may understand whatever it is that I am trying to drive at. First of all, what is website hosting?
Whenever you are done with your development process of a mobile or web application, you would want this website to be avaible out for your customers or intended recipients to use. For this to be possible, the website should be available of the internet 24/7. This is very possible to achieve with your computer, however, it is so hard to maintain. The maintenance comes with alot of demands, continuous power supply to the machine, uninturrupted internet access and powerful hardware are just but a few demands.
To save on time and cost, we always opt to hire someone's machine somewhere that is constantly connected to the internet. This machine is what we cal a server and this "someone" is a host provider or hosting company. There are sseveral hosting companies available to choose from whenever you want to deploy your application to the internet, some of the few hosting companies in 2023 are AWS, Heroku, Vercel, Railway to mention just a few.
Website Migration.
Each and every host provider has their own complications and issues that you may not know of until when you are onboard and testing your application on a live environment. If by chance you already did some deployment on AWS, bought Domain name and an SSL Certificate and configured your hosting DNS to your Domain name provider, then generally speaking, you really wouldn't like to terminate everything and move the entire applictaion to Heroku or any other host provider unless circumstances really forces you to do that.
Anyway at some point, you may oblige to do a website migration from your current host provider to a completely new host provider. It comes with much pain, but some times, it is worth it.
Preparing for a seamless website migration.
Before you do your website migration, there are a few things that you really should be aware of.
1. Database Backup.
Some small websites uses default databases used in development for deployment. For instance Django framework comes bundled with sqlite3 database. I would not recommend taking sqlite3 database to production, however, you can get a Database host and host your database in a separate environment. With this, during migrations, you will not touch anything on your database, you will only be dealing with Backend and Frontend code here and perhaps a few static files. So always, ensure you have a backup of your database before initiating a migration process. Anything could go wrong, you never know.
2. DNS Propagation.
If you have to migrate your website, DNS caching across all servers around the world shall be updated one after the other with the new DNS records from your new host. This may cause a downtime sometimes for 48 hours. Regretfully, there's nothing you can do to speed up the process. If you have a busy website that a downtime of 1 hour could cause very huge loses, then consider if 48 hours downtime will be worth the risk.
3. CDN Nameserver configurations.
If you had set up a CDN to serve and optimize your website performance, you will have to sync the cache with the updated content from your new host. This may sometimes involve manually restarting the CDN caching. Cloudflare has the functionality to restart the caching process and sync new data across Cloudflare servers available all around the world. Caching new content may not take alot of time, however if you also tampered with the CDN DNS configurations on your Domain name provider dashboard, you should know that this as well takes time becasue all the CDN servers distributed across the world must be updated, I bet there's nothing you can do to speed it up.
How to do a Website migration step by step.
1. Ensure you have a Backup of your database and Project Code. The backup of your database ofcourse depends on where and how you hosted your database, on the other hand, your code could be backed up using a version control such as Github or Bitbucket during the development process.
2. Delete previous configurations from your previous host provider. Delete the application and terminate any associated containers if any before beginning to set up the hosting environment on your new hosting company.
3. Reconfigure your DNS on your Domain Name provider. If the DNS configurations currently points to the previous server, Delete them and update them with the current DNS configurations from your current server.
4. Upload your website to the newly configured server and configure the Domain name.
5. Wait for few hours for the DNS propagation to take effect. As I said early, you have no control over the speed of the propagation. Just be patient.
6. After the DNS Propagation is complete, it is now time to update your CDN Servers incase you had any set up. Go to your CDN server and restart the caching process. If you had no CDN setup, then yous should be good to go on Step 5.
Conclusion.
The most important thing to master here is this simple process to do website migration. If you follow this approach, you will never have any problems when migrating your website. I wish you the best of Luck.
VoltageITLabs