When I first arrived in the Biology Department, the webserver was mostly the province of geeks: they were the only ones who know anything about it -- or cared, really. We have consistently been ahead of the curve in terms of engaging faculty and staff in building and maintaining web services, but over the past two years we've turned a corner. The conventional wisdom has finally shifted and what used to be considered an addendum to the Department's public image, the website is now the pre-eminent way in which the Department presents itself to the world.
One effect has been that I'm much less comfortable hacking on the live site to make changes to drupal, update modules, etc. Several months ago, I sent an email to the technical staff saying that we needed to construct a system for staging so that we could update our multi-site drupal installation and do testing, without affecting the production site, and then switch when we were ready. Over the past two or three days, we finally made it happen.
I spent a good time of time looking to see if there was a common way everyone did this, but it seems like each sysadmin rolls their own, so that's what we did.
Conceptually, it's simple: we duplicated the webtree and called one "htdocs-yin" and the other "htdocs-yang". We similarly duplicated all of the drupal databases into yin/yang versions. The script looks to see which way htdocs is pointed (yin or yang) and replicates everything from one to the other -- this builds the development mirror -- and rewrites the drupal settings files to use the new copy of the database. The second script just switches which way the symlinks point.
With development space, I could finally update the department website: I updated drupal from 6.14 to 6.16, updated about 12 modules, installed a new module, and made some scary changes to some views that are prominent features of the site. Everything seemed OK, so we pulled the switch and we're now using the updated version of the site.
If there had been a serious problem after we switched, I could have just run the switch again and it would swap them back again. Next week, I can start working on doing some significant development for the department site and not have to worry that my changes will break the production site. A very satisfactory accomplishment.
- Steven D. Brewer's blog
- Log in to post comments