Upgrade FAQ

Can I use Capistrano 1.x recipe files with Capistrano 2.x?

Kind of. The recipe file syntax is backwards compatible, but the internals have changed drastically, and the deployment system has been rewritten. If your scripts make any changes to the default deployment recipes, or if it uses any libraries that extend Capistrano, you might not be able to get away with just dropping cap2 in place and having things work.

Can I have both cap1 and cap2 installed at the same time?

Yes, if you are using Rubygems. If you have installed Capistrano some other way, you'll be at the mercy of whatever system you used to install it. However, if you used Rubygems, you can invoke the older installed version of Capistrano at any time by explicitly specifying the version that you want:

cap  _1.4.1_  deploy

That will invoke the deploy task using Capistrano 1.4.1 (as installed by Rubygems). If you leave off the version specification, the newest Capistrano will be invoked.

Can I add a guard to my recipes so that they can only be used with one or the other of Capistrano 1.x or 2.0?

You could add something like the following to your config/deploy.rb:

abort "needs capistrano 2" unless respond_to?(:namespace)

That will abort Capistrano unless Capistrano 2.0 is being used. Conversely:

abort "needs capistrano 1" if respond_to?(:namespace)

That'll abort if you try to use Capistrano 2 when the script requires Capistrano 1.