title: copy production database to staging capistrano
body: <p>I am using rails and capistrano with a staging and production server.  I need to be able to copy the production database to the staging database when I deploy to staging.  Is there an easy way to accomplish this?</p>
  
  <p>I thought about doing this with mysql and something like:</p>
  
  <pre><code>before "deploy:migrate" do
    run "mysqldump -u root #{application}_production &gt; output.sql"
    run "mysql -u root #{application}_staging &lt; output.sql"
  end
  </code></pre>
  
  <p>(I have not tested this btw, so not sure it would even work)
  but it would be easier / better if there was another way.</p>
  
  <p>Thanks for any help</p>