Server security is a top priority for every system administrator. In addition to third-party security tools such as firewall, DDoS protection, etc., it is important that every piece of code on your production server is updated.
If your application is in production, an upgrade is more risky. If your server is running on Linux, Linux distributions release new versions from time to time. Each major release includes bug fixes, security updates, and new tools.
Updating a production server without preparation is a big mistake. Unprepared updates can result in permanent data loss, poor server performance, and loss of customers. In this article, I will mention some important steps to follow before updating the server.
Things to do to upgrade a production server
I recently updated one of my client servers, Ubuntu. The e-commerce website has a considerable amount of traffic and has been in use for almost a year.
I decided to upgrade the server from Ubuntu 18.04 to 20.04 LTS. The actual upgrade took about 30 minutes, but the preparation took longer. As a result, the update went smoothly and without downtime.
Preparing a full backup
Backing up the website or the entire server should be a daily task. Before you upgrade, make sure your site is fully backed up in the cloud or locally. I recently made a list of the best backup plugins for WordPress. If your website runs on WordPress, read the article about the best backup plugins for WordPress.
If you are using a different CMS, make a backup of the application. If you use cPanel hosting, you should be able to make a full backup of the entire server. Creating a full backup of cPanel is the easiest way.
If you are using one of the cPanel panels I have described in my series of articles about cPanel, you all have the possibility to make a full backup. All these Linux cPanels are free and open source. Let me know if you have any problems with any of the panels I’ve reviewed, and I’ll help you.
Once you have made a full backup of your server, you can proceed to the next step.
A more recent Linux distribution may have removed or replaced the tools used by your website or CMS. Popular CMS like WordPress will have no problem. If you have a custom CMS that can use a specific library, make sure it is always available in a newer version of the operating system.
Setting up a temporary server
The purpose of this article is to update a live server without downtime. The server can restart multiple times during the upgrade, so the website will not open during the restart. The best way to prevent this is to set up a separate server and restore your site to a new server.
You can restore the backup to a new server and temporarily specify the domain name on the new server. During the update, visitors visit the temporary site instead of the main site.
We have already seen in detail how to move a WordPress site from one server to another.
The load balancer is the best way to manage the traffic on your website and make sure that every visitor has access to your website, no matter what happens on the server. A load balancer can cost a bit, but it’s worth it if you get a lot of traffic to your website.
During the upgrade, we can use premium load balancing services and redirect all traffic to our temporary server without changing the domain settings.
If you’re using the Cloudflare firewall, you’re in luck. Cloudflare offers load balancing at a cost of $5 per month. It’s cheap and you can cancel it at any time.
Enter the IP address of the site’s main server and the temporary server into the load balancer. Once the servers have been successfully connected to the load balancer, the load balancer redirects visitors to a website that does not work.
If your main server does not respond during the update, the load balancer will serve the visitors of the temporary website. After updating the server we can remove the temporary server.
Starts server update when the lowest traffic volume is.
While the above points will help prevent your services from crashing, it is best to start updating when the site is least crowded. You may use Google Analytics or another website analysis service in connection with your website.
After upgrading the server you can enter the domain name on the main server and remove the temporary server after a few hours. If you have not changed the domain settings and used the load balancer instead, you can delete the temporary server and remove the IP address of the temporary server from the load balancer.
A bad update can be a real problem for your services. It is important to schedule server updates and to avoid data loss during the update.
LinuxAndUbuntu hosting is sponsored by MassiveGRID .
server upgrade meaning,server upgrade checklist,reasons to upgrade server hardware,server upgrade plan,server upgrade cost,questions to ask when upgrading a server,how often is linux updated,how often does ubuntu update,do i need to update ubuntu,who created linux and why,what is a server upgrade,benefits of upgrading servers,how to upgrade server hardware,server upgrade project plan