This morning a friend of mine discovered that his hosting company had “accidentally” deleted his website. I spent a good part of the morning helping him pick up the pieces. The good news is they didn’t touch the database used by WordPress. So most of his content was safe. After reinstalling WordPress and restoring some database tables, his site was back functional. None the less, he had to reconfigure his themes and re-upload some images.
Website backups are fairly easy to do. If you’re using a blogging system such as WordPress, you’ll need to backup your database and your web application files. Some hosting companies will perform snapshot backups on a regular bases. But not all hosting companies do. For some of my projects I’ve setup scripts to copy the application files nightly and dump a copy of my database locally. You could use a utility called “wget” to grab your application files. For MySQL databases, “mysqldump” also works well. Both are available for Windows and Linux.
Whatever backup strategy you use, be sure to test it. Performing a mock restore maybe the best way to ensure, you’ve got everything you need. A few hours worth of work now, may ease pain and suffering later. My friend has already switched hosting companies and has a backup plan in place. A good end, to a bad story.