We can say without a doubt that data is the most important asset of any business nowadays. The loss or leak of the important information of your company may be an inconvenience at best, but in some cases it could spell disaster for a business or even destroy it entirely. That’s why it’s best to prepare for the worst and have solid disaster prevention and recovery plans in case of data loss.
In this article, we’ll talk about creating and restoring backups for shared hosting users as well as VPS/VDS users, the importance of keeping a local copy of your backups, database dump and more.
Convenient daily backups included in our shared hosting plans
If you are a VPSBG shared hosting user, you’re all set - automatic daily backups are included in every web hosting plan we offer. You can access the backups from the previous 14 days and restore the one you need at the click of a button. The backups are managed using JetBackup through your cPanel and you have the choice of restoring just a single file, a whole folder, your database or your entire cPanel account. To read more about restoring data via JetBackup, head over to the article in our Documentation.
Keeping a local copy of your backups is best
So, should you rest easy in the knowledge that we backup your website for you and if anything goes wrong you can revert your files, folders and database to a previous state? Well, not exactly. While we pride ourselves on the excellent uptime of our services (guaranteed 99.99% uptime) and our servers are collocated in a modern and advanced data centre with a focus on fault-tolerance and redundancy, the unexpected does sometimes happen. That is why it is best to have a backup of your important data not only in one location but a minimum of two. Yes, JetBackup is very convenient and flexible for restoring your data in seconds, but you definitely should have a plan B in case this option becomes unavailable for any reason. What you can do in order to be absolutely certain that you are well guarded against any data loss calamity, is to regularly download and keep a local copy of your backups. Thankfully, this is just as easy with JetBackup. To download a full backup of your site, follow the handy guide in our Documentation.
Automatic backups for our VPS and VDS servers
Since we all know how important backups are, we could not leave our VPS users without a similar solution. That is why we have started offering automatic backups for our VPS clients as a paid add-on to their plan. They are disabled by default, but you can easily enable them at any time from the client area. Head over to this article for a step-by-step guide on activating automatic backups for your server. Backups will be performed once weekly and the newest 3 backups will be kept, so in effect, you will always have access to backups from the previous 3 weeks. Our custom solution makes rolling back to a previous state quite easy, but we have a guide for this as well in case you need help. Please be aware that booting from a backup is similar to a non-graceful shutdown, i.e. it can cause issues if apps that constantly write information were running during the backup process, so proceed with caution. To be extra certain that your project or site can be restored at any time and in any circumstances, we recommend that you also keep a local copy of your backups.
Server snapshots - a great and a free solution
Let’s say you don’t feel you need automatic backups and you are more than happy to make your backups only when the need arises. We have a simple solution for you as well. You can create snapshots of your servers manually when you need to directly from your VPSBG client area. And while this service is completely free, you need to be aware that there are some limits - you can create one snapshot per server, up to 5 snapshots total per account and up to 3 snapshots per day. The snapshot options are located in the Snapshot/Backup tab of the service page in your client area. From there you can view, create and download your images at your convenience.
Database dump - what is it and why should you do it
In addition to backups or snapshots, we suggest you regularly make a dump of your database. Server snapshots and backups are made while your server is working. While most modern systems can handle these cases very well, there is a slight chance of breaking your database and that’s why we suggest making database backups locally and then transferring them to a different location. This can save your project in the event of data loss as well as database corruption. It’s best to perform database dumps often, ideally at a regular interval and also before making major changes to your project. If you are using MySQL (or MariaDB) the process is made simple using mysqldump. This is a database backup program that produces logical backups of your database, which are stored in ordinary text files. What this means is that the actual data files are not copied, but instead a series of SQL statements are produced which when executed reproduce the original database. Backups created by mysqldump can be completed in a couple of minutes, while full snapshots of the server may take hours depending on the size of the disk. Additionally, the file produced by mysqldump is much smaller than a full image of the server. Therefore, you can quickly restore your database or copy it to another SQL server, if needed.
If you are new to mysqldump, we will try to explain briefly how to go about using it. Mysqldump is highly flexible and allows the backup of a single database, multiple databases or all databases on the server. You can even backup a single table, if that is what you need. Here is the basic syntax:
Exporting a single database:
mysqldump -u USERNAME -p DBNAME > DBBACKUP.sql
Exporting multiple databases:
mysqldump -u USERNAME -p --databases DB1 DB2 DB3.. >DBBACKUP.sql
Exporting all databases:
mysqldump -u USERNAME -p --all-databases > ALLDBBACKUP.sql
Importing a mysqldump is just as simple. First, create an empty database, if one does not already exist (e.g. when you are changing hosts). Then, use the following command:
mysql -u root -p DBNAME < DBBACKUP.sql
We will not go into more details here, as there are numerous excellent tutorials on using mysqldump already available.
Sometimes planning your recovery from a catastrophe that may never happen can seem like a pointless chore, but in reality, data loss happens way more often than we like to imagine. Even before you start a new project or launch the website of your small business, you should ask yourself what you need to do to keep it up and running if any adverse circumstances arise. Decide on a plan and the tools you are going to use and be confident that your work will not be lost no matter what. We hope our solutions can help with this and make it easier for you to devise and implement your backup strategy. If you struggle with making a backup plan for your business, always feel free to contact us.