Depending on the arrangement with your data center or hosting provider, they may offer you some form of "off-server" backup. In some cases, you identify a folder for them to backup (which you will copy all of your mission critical items to each night before the backup takes place). In other cases, they will backup the entire box. And, in still other cases, they will backup folders that you specify.

But, where does the database backup come into play in either one of those scenarios? Of course, the physical database files are backed up. If you are using MySQL for example, your .FRM, .MYD, and .MYI files will be backed up, allowing you to stop the MySQL server and replace the files.

But, how do you know you won't be overwriting records created since the backup?

In my personal experience, it ALWAYS makes sense to maintain a nightly mysqldump-style backup on the actual server.

mysqldump is an excellent command-line utility for this purpose. It allows you to dump the db structure and data in SQL format, so it can be easily interpreted by you, and individual records can be restored if needed.

Running this command from a cronjob is a breeze and can really save you some headaches.


Leave a Reply

Your email address will not be published. Required fields are marked *