I managed to blow my blog away last week, in the process of trying to get a big-chair development environment set up:
Eclipse connects to a Subversion repository on the central server, checks out files to a local Apache 2 wwwroot, where PHP talks to a local MySQL database. When dev work is complete, the files are checked back in to the central repository.
An ANT build task checks out the Subversion HEAD revision to an Apache 2 wwwroot, where PHP talks to the MySQL database.
Theoretically, I should be able to fire up eclipse, make changes and immediately browse the changes using my local WAMP (Windows-Apache-MySQL-PHP) environment. Then I should be able to commit my changes, trigger the ANT build task, and see the changes immediately reflected in the production LAMP (Linux-Apache-MySQL-PHP) environment. Automated deployment is cool, no doubt about it; you can view source on this test page and see Ant’s build timestamp in the comment at the bottom of the page. At least, that’s how it should work in theory.
In theory, theory is the same as practice, but not in practice. PHP and MySQL have both made small-watershed changes, and I forgot that I had newer versions running on my central server that on my local machine, with the result that PHP’s db-abstraction utility PEAR worked just fine on the production site, but not locally. When I changed the access method, it worked fine locally, but not on production. #@#$@!! So I chose a version of PHP and MySQL to standardize on, blew away my local install of MySQL, blew away my central install of MySQL, and…
Oh, crap. That database held my blog. And no, I don’t back up to tape. And yes, I did conscientously go in and scrub everything out of /var/lib/mysql. I left no stone standing upon any other stone. I razed the buildings and salted the earth.
All was not lost, fortunately — I only migrated from Blogger about two months ago, so I just re-exported all 475 posts from there and slurped them back into MovableType (though I did lose comments in the process.) Then I re-created my six posts since then by copying the HTML out of the static pages that still existed. But there’s a hell of a lot to be said for having someone else maintain your important stuff.
And nightly backups.