Capistrano: disable deploying to your database server

By default Capistrano will try to deploy your code to whatever server you have set to the :db role, and will try to run the migrations there too.

I’m happy with my database as it is right now so I wanted to disable it.

Here’s how. Just comment out:

before ‘deploy:restart’, ‘deploy:migrate’

or to enable it see:

http://stackoverflow.com/questions/4895450/how-to-modify-capistrano-deploy-to-automatically-run-migrations-in-rails-3-0/4897555

There’s a more complex discussion (with roles) here:

http://wagglelabs.com/2008/09/disable-deploying-to-your-database-server-in-capistrano-2/

If you’re doing a deploy:cold then it automatically runs a db:migrate. So, when you want to do an initial deployment without a migration use:

deploy:update

Leave a Reply

Your email address will not be published. Required fields are marked *