One of the crucial components of a WordPress site is the database and it should be backed up on a regular basis to avoid the misfortune of the database becoming corrupt, hacked or deleted.
WordPress uses a mysql database, which can be managed by the mysql commands on a command line or by phpMyAdmin through a web browser, both methods are advanced and require some degree of learning.
A great cool tool to work with the database, through a WordPress interface is available by Lester Chan, it is simple and intuitive and very handy!, called WP-DBManager and available here. The installation should be fairly simple but there are instructions if you come undone.
The easiest way to install is via your WordPress site, Plugins page > Add New >, type in WP-DBManager, install and then activate.
Once activated you will get an error in WordPress –
Your backup folder MIGHT be visible to the publicTo correct this issue, move the .htaccess file from wp-content/plugins/wp-dbmanager to /home/username/public_html/wp-content/backup-db
The htaccess file is a security file that controls who can see a folders contents, in this instance the file is named htaccess.txt, move it from the first directory to the second (in the above path) and rename it “.htaccess”, you will need to do this either in your FTP client or the file manager in cPanel. Since you will rename htaccess.txt to .htaccess it will become invisible so turn on show invisible files in your FTP/File Manager.
The files contents are:
<Files ~ “.*..*”>
order allow,deny
deny from all
</Files>
Which “deny from all” means that no one via the web/http protocol can see the contents of the folder, but you can see through your private ftp/file manager tools.
Once you move and rename that file the error goes away and now you can start to back up your mysql database which will have a left side menu in WordPress at the bottom called “Database”.
The first thing to do is to click Backup DB and backup the database, you can verify the db backup by checking in public_html/wp-content/backup-db directory. Once the back up is in there you can now set up a schedule to back up and email a copy to you. Click on DB Options and go to Automatic Scheduling, here you can set the back up frequency, whether or not it is emailed and optimised. Frequently changed sites should have a daily backup and infrequent ones at least a weekly backup.
The default amount of backups that will be stored is 10, you can adjust this also in DB Options and put in the desired amount, now with copies of the database stored in both your /wp-content/backup-db folder and also your email inbox you have options to restore the database to a previous state.