<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/tasks/database.rake</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,37 @@
 set :stages, %w(staging production)
 set :default_stage, &quot;production&quot;
-require File.expand_path(&quot;#{File.dirname(__FILE__)}/../vendor/gems/capistrano-ext-1.2.1/lib/capistrano/ext/multistage&quot;)
\ No newline at end of file
+require File.expand_path(&quot;#{File.dirname(__FILE__)}/../vendor/gems/capistrano-ext-1.2.1/lib/capistrano/ext/multistage&quot;)
+
+
+namespace :db do
+  desc 'Dumps the production database to db/production_data.sql on the remote server'
+  task :remote_db_dump, :roles =&gt; :db, :only =&gt; { :primary =&gt; true } do
+    run &quot;cd #{deploy_to}/#{current_dir} &amp;&amp; &quot; +
+      &quot;rake RAILS_ENV=#{rails_env} db:database_dump --trace&quot; 
+  end
+
+  desc 'Downloads db/production_data.sql from the remote production environment to your local machine'
+  task :remote_db_download, :roles =&gt; :db, :only =&gt; { :primary =&gt; true } do  
+    execute_on_servers(options) do |servers|
+      self.sessions[servers.first].sftp.connect do |tsftp|
+        tsftp.download!(&quot;#{deploy_to}/#{current_dir}/db/production_data.sql&quot;, &quot;db/production_data.sql&quot;)
+      end
+    end
+  end
+
+  desc 'Cleans up data dump file'
+  task :remote_db_cleanup, :roles =&gt; :db, :only =&gt; { :primary =&gt; true } do
+    execute_on_servers(options) do |servers|
+      self.sessions[servers.first].sftp.connect do |tsftp|
+        tsftp.remove! &quot;#{deploy_to}/#{current_dir}/db/production_data.sql&quot; 
+      end
+    end
+  end 
+
+  desc 'Dumps, downloads and then cleans up the production data dump'
+  task :remote_db_runner do
+    remote_db_dump
+    remote_db_download
+    remote_db_cleanup
+  end
+end
\ No newline at end of file</diff>
      <filename>config/deploy.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>d0dc0425eadd05fa241dfaf0e1a6778953c78f0c</id>
    </parent>
  </parents>
  <author>
    <name>Matt Hall</name>
    <email>matthew.hall@gmail.com</email>
  </author>
  <url>http://github.com/laktek/extended-bort/commit/b3379b735bc3139ca1fa734114f72ed437e63dcb</url>
  <id>b3379b735bc3139ca1fa734114f72ed437e63dcb</id>
  <committed-date>2008-09-30T01:51:16-07:00</committed-date>
  <authored-date>2008-09-30T01:51:16-07:00</authored-date>
  <message>Added database backup dump script</message>
  <tree>48226917be1d9f51b86e64ed981a3724c5c4539d</tree>
  <committer>
    <name>Matt Hall</name>
    <email>matthew.hall@gmail.com</email>
  </committer>
</commit>
