Skip to main content

Simple and Powerful Drupal Site Deployment with Capistrano

PreviousNext Technical Director, Kim Pepper explains how to effectively manage site deployment and take control of your releases using Capistrano.

by kim.pepper /

Are you still using FTP to deploy changes to your sites?Kim Pepper explains how to effectively manage deployment using Capistrano.

When you run the one-line deploy command you get:

  • Automatic database backup
  • Pull in changes from a git repository
  • Automatic 'update db' call
  • Automatic cache flush
  • Ability to roll back releases
  • Support for mulitple servers, including separate varnish, app and db servers

Posted by kim.pepper
Technical Director



Comment by Les


When you do a rollback, how does this affect your database? A potential problem I envision would be you do a deployment which involves altering the database in a way that if you rollback, your site would cease to function. How do you handle rolling back the database as well? You probably addressed this and I missed it, and if so, sorry :)

Comment by kim.pepper


We use backup_migrate module to take a backup before running updatedb(). A normal rollback doesn't automatically rollback the database, just code. However, a snapshot is there, and available from the backup_migrate settings if you need to rollback the database, and don't have ssh access to the server.

Comment by Florian


Great video! Thank you for sharing this.

One idea on the rollback of the database:
If you safe your db-dump before running updatedb you could give it the timestamp of the last release. And on Rollback you could import this old dump by using the timestamped dump - or missed I something?

By the way: How do you do config management under drupal7? I'm using features module all over the sites configuration to have a version controlled config.