Better safe than sorry: precautions to take before changing your website
When introducing any changes to your website, you do it with the best intention. Be it a regular update, a slight code adjustment, or even complete redesign, all of these modifications are aimed at improvement.
But sometimes,things go wrong and everything turns into a complete disaster. Instead of making better, you end up with non-working pages and errors everywhere. For sure that’s not the result you have expected.
How to avoid these mistakes?
Following the precautions below, you will be safe to make updates anytime. So let’s have a closer look at them:
Apply changes on Sandbox first
No matter how big your temptation is just to change one string of code on production, even when it does not seem important, please refrain from doing it on the live website. Back to the time, when you just started your CSS training, learning HTML or other basics, you learned that you cannot just write code in the notepad and need some special tools such as Visual Studio Code, or any similar tool to be able to preview how your code looks. You might even set up a local server environment on your computer to test the settings before publishing it. That’s a good move!
Still, you need to check how your code feels in real-life conditions i.e. introducing the functional when you use shared hosting may bring it down. So it’s better to have a Sandbox possessing approximately the same server specs where you will be able to test it. Sometimes this process is called Website staging (you can even have a separate hosting account at your local provider for such purposes).
When in doubt, make backups
Just have a copy of your website, better two. That’s a golden rule when you plan to touch anything related to your website. Even when you don’t have such plans, you never know when there is a hacking attempt or unexpected CMS automatic updates that can bring your website down. There exist many backup solutions to any taste. Starting from features inbuilt in your hosting control panel to some external tools such as R1 Soft Backup or Codeguard.
If you use WordPress, Magento, OpenCart or any other popular CMS, you may take a look at different plugins offering automatic updates before any change is made. You can even do it manually by compressing all the files in your website directory and downloading them to your PC.
In case your website contains databases, you may wish to download database backups separately. The majority of hosting providers use PHPMyAdmin plugin to manage databases, so you can log in to it and export the database in question.
You can find the database name assigned to the website in the configuration files. Usually, they bear the ‘conf’ or ‘config’ part in the file name. If that’s a custom-coded website, you probably know the exact name. In this article, we will illustrate the database modifications on the example of WordPress since it’s the most popular CMS on the market. For WordPress, the config file is called wp-config.php and looks as follows:
Note: For the other popular CMS the config files bear the following names:
OpenCart – config.php
Magento – env.php (newer version) and local.xml at /app/etc for the installation directory (older version)
Here’s how to export the database when you know the name:
1. Log in to PHPMyAdmin interface and locate your database:
2. Click on it. Once the database opens, press ‘Export’
3. When you press it, you will be prompted with options regarding the Export method and Format and select ‘Go’.
Here we leave the default options and press go so that the database is exported to your PC and ready to work in the local environment.
Don’t mess with SEO
If you plan massive updates related to the website structure that take several days, make sure that your SEO is not affected. Once you tested everything on the Sandbox, make sure there are no broken links that can result in 404 errors on your website that are extremely bad for SEO.
Also, it’s necessary to make sure that all the links that were available in the old version but will not be present in the new one, are properly redirecting. In addition, before going live, check all the subpages once again so that you can re-assure that everything will be fine. In addition, you may also want to discourage the website from crawling during the updates.
If you are playing with Sandbox on a live hosting, you will definitely need to close the page from public accessibility as when Google detects duplicate content, it will be hard to bring back the previous SEO results. If your hosting uses the Apache server, you may do it via modifying your .htaccess file. Add there the following string:
Make sure that you replace 22.214.171.124 with your actual IP address to work on the website.
Take care of security
Security is the main pillar of your website. Everything is based on security: your website accessibility, chances to fall victim to malicious attackers and reliability of the system. It’s no less important when you are planning the updates to your website. Even if a vulnerability in software is detected, you will have time to roll back to the previous version without being affected provided that other parts of the system are protected.
Among the key security measures are server-based: installing and configuring the Firewalls, taking care of anti-malware software and keeping logs monitoring, automatic security updates. When we talk about website-based security these are restricting access to the admin side of your pages such as blocking login links, security plugins and keeping the latest version of the software you use.
Apart from the server and website, there are some ground rules neglected by the majority of people such as strong passwords, using official and licensed software only and avoiding opening any suspicious emails. Security measures are crucial when making changes to your website as MySQL injections or cross-website scripting and other not pleasant attempts to hack a website occur when you introduce the updates such as installing a new template on your website or upload some files.
Some of these tips may seem obvious and simple, still, due to that, they are not taken seriously that is why the cases when websites going down after the updates are introduced are still widespread. Unfortunately, in most cases, people start following these rules only after they had a bad experience during making changes or after them. However, it’s much easier in terms of time and effort to prevent the catastrophe than to deal with the consequences.
Now when you know what things are crucial during the updates, it will be easier to have a checklist of things to do before introducing updates. Moreover, to keep your website safe and sound!