For those that utilize a MySQL database, whether for a blog, discussion forum, photo page, etc. it is so important to make regular backups of the database(s). You never know when or if the database could be corrupted for any reason.
It is very easy to backup your database, so don’t be afraid! This article will cover a few simple backup (and restore) solutions.
Does your hosting provider offer Cpanel as part of your hosting plan?
If you have access to Cpanel, then you also should have access to the “Backup Wizard” – on the Cpanel main page, check the category “Files”. You should find the Backup Wizard there.
This is a very simple, straight-forward way to backup your entire web site, including all databases. If you just want to backup only your databases, then click the MySQL database link and choose the specific database to backup. Save each file to the folder on your hard drive where you plan to store your database backups.
There is also an option to restore your whole site or a particular database.
The Backup Wizard is probably the easiest way to backup your web files.
If you cannot find the Backup Wizard, or your host doesn’t offer cpanel as part of your hosting package, then contact them to find out what tools are available to you to backup your database(s).
Want to learn more?
phpMyAdmin also offers an easy way to backup your MySQL database. For more advanced users, it offers customized backup options, but truthfully, I backup using only their default settings.
Look for phpMyAdmin on the cpanel main page, check for the “database” category. phpMyAdmin should be found there.
Once signed into phpMyAdmin, choose a database from the left column. If you have more than one, all will be listed.
In the tabbed menu, now choose “Export”
By default, all your tables are selected, but to be sure click the “select all” link and make sure the radio button next to “SQL” is selected. Keep all the other settings as the default. To be truthful, I really don’t know exactly what’s up with all those settings, so I keep everything as is.
Next, toward the bottom, check the box next to “Save as File” – type in a name for your file – and depending on your preferences, choose either “Zipped” or “GZipped” – I choose gzipped, but Windows users might want to choose “zipped”.
Click the “go” button and browse to the folder on your hard drive where you plan to store your database backups.
If you ever do need to restore your database, choose the “Import” tab and navigate to the most recently backed up file.
Some web applications offer a database backup feature. For example, from the Admin option in Expression Engine, there is a utility to backup the database. Same with my discussion forum software Simple Machines.
Check the software you are using to see if there is a backup utility offered.
I found an indispensable script that automatically backs up all my database(s) every night, and then again weekly and monthly. On a regular basis, I download and save the latest backup file for each of my databases, so I can keep copies safe on my hard drive.
It’s been a couple of years since I enabled the script, but I did write an article with detailed steps to install the script and set up a cron job:
cron jobs & backing up database data
I also found another article that explains the process.
No matter which option you choose to backup your database data, just do it, and do it often. It is especially important right before you upgrade software. If something goes wrong with the upgrade, you can always revert to the prior files and database.
Commments are closed for this article.