We don’t run many Drupal sites, but there are enough of them. I wish the upgrade path for Drupal was as easy as Wordpress’s svn-based upgrades, but I’ve borrowed some ideas from Rails and Capistrano to make my process a little quicker than it might be otherwise.
Each Drupal upgrade provides a zip file (unless you’re working with CVS and frankly I’d rather not). Each of our Drupal sites has its own user, and the site root lives in the home directory of that user (e.g. ~/public_html or ~/www.) I started by unzipping each version of Drupal independently in the home directories (e.g. ~/drupal-6.14, ~/drupal-6.15.) Then I would make public_html a symbolic link to that directory. This meant I could “flip the switch” between versions with one command:
$ rm public_html && ln -s drupal-6.15 public_html
Still, I needed to copy a bunch of site-dependent files (e.g. the drupal/sites/* files, among others) between the old versions and the new, and that was getting tedious. So finally I created a shared directory, ~/shared/ with all the site-dependent files. This served to take those files out of the “deploy path”. Now I can use symlinks to install them in each new version in turn:
$ cd ~/drupal-6.15/sites/all/ && ln -s ~/shared/sites/all/* ./ $ cd ~/drupal-6.15/sites/default && ln -s ~/shared/sites/default/* ./ $ cd ~/drupal-6.15/themes && ln -s ~/shared/themes/* ./
Undoubtedly someone has already scripted this stuff, but I was pretty proud of it so maybe it will be useful to someone else. (There’s always Deploying Drupal with Capistrano, but I think that’s solving a slightly different problem.)
