I use rails and capistrano with an intermediate and production server. I need to be able to copy the production database to an intermediate database when deployed to the stage. Is there an easy way to do this?
I thought about this with mysql and something like:
before "deploy:migrate" do
run "mysqldump -u root #{application}_production > output.sql"
run "mysql -u root #{application}_staging < output.sql"
end
(I have not tested this bit, so I'm not sure if it even works) but it would be easier / better if there was a different way.
Thanks for any help
source
share