lib/eycap/recipes/database.rb in engineyard-eycap-0.4.4 vs lib/eycap/recipes/database.rb in engineyard-eycap-0.4.5
- old
+ new
@@ -23,9 +23,12 @@
dbhost = @environment_info['host']
dbhost = environment_dbhost.sub('-master', '') + '-replica' if dbhost != 'localhost' # added for Solo offering, which uses localhost
run "mysqldump --add-drop-table -u #{dbuser} -h #{dbhost} -p #{environment_database} | bzip2 -c > #{backup_file}.bz2" do |ch, stream, out |
ch.send_data "#{dbpass}\n" if out=~ /^Enter password:/
end
+ run "mysql -u #{dbuser} -p -h #{staging_dbhost} #{staging_database} < #{backup_file}" do |ch, stream, out|
+ ch.send_data "#{dbpass}\n" if out=~ /^Enter password:/
+ end
else
run "pg_dump -W -c -U #{dbuser} -h #{production_dbhost} -f #{backup_file} #{production_database}" do |ch, stream, out|
ch.send_data "#{dbpass}\n" if out=~ /^Password:/
end
run "psql -W -U #{dbuser} -h #{staging_dbhost} -f #{backup_file} #{staging_database}" do |ch, stream, out|