By T.J. Buffenbarger
Earlier today TJSlideways.com had what I would consider a catastrophic failure. Once per month we try to optimize our database to make sure our database runs smoothly. At the same time I have been fighting a disk space issue with my web host that I’ve been working with them on for about a month on our root partition. When doing the database optimization this afternoon that partition filled up and corrupted our database table where all of the stories are stored.
This failure could have sent two years of data down the drain. Thankfully last year I took about a month to perfect a backup procedure that takes all of our data and sends it to an offsite server early in the morning. The databases are backed up in full every nice and we do incremental backups on files throughout the week and a full backup on Monday morning. I even built in a feature that e-mails me if the backup was successful or not. Not only did I make sure the data was backed up but made sure it could be restored, and documented how to do so. I even test backups monthly to make sure we can easily recover a file or database.
Because of this preparation I was able to restore our database in a relatively short period of time, only losing the stories that were posted this morning. The site was functional again in a little more than an hour. Thankfully the only data that was lost were a few stories and photos we still had in our e-mail deleted items box that we can re-post this evening.
Its nice to know the work I put in last “Code-vemeber” worked to our advantage and saved the day. The only improvement now that we have had a failure is I plan on figuring out how long our database backups take so I can add an incremental backup to them during the day that stays on the server.
If you run a website make sure to come up with a good backup plan. Not only make sure you back up data, but also test restoring it periodically to make sure that your backups are valid. The work you put into developing such a program could save you a lot of headaches later on.