markjaquith/WP-Stack

How to run db:sync

bigandy opened this issue · 3 comments

Having difficulties with db:sync. Not working for me when I run cap staging db:sync

Outputs :

triggering load callbacks
executing staging' triggering start callbacks fordb:sync'
executing multistage:ensure' executingdb:sync'
Hang on... this might take a while.
db:sync
staging
The system cannot find the path specified.
Database synced to staging
Memcached flushed

Any ideas what I am doing wrong?

I have found that changing system to run on the following lines :
run "mysqldump -u #{p[:user]} --result-file=/tmp/wpstack-#{random}.sql -h #{p[:host]} -p#{p[:password]} #{p[:name]}"
run "mysql -u #{s[:user]} -h #{s[:host]} -p#{s[:password]} #{s[:name]} < /tmp/wpstack-#{random}.sql && rm /tmp/wpstack-#{random}.sql"

works but not figured out how to do the rsync part yet. Help!

Also figured out the rsync part. Need to have ssh key added to keychain on server.

I also had to change system to Run to get it to work :

run "rsync -avz --delete #{production_deploy_to}/shared/files/ #{server}:#{shared_path}/files/"

Cheers @bigandy, useful tips. @markjaquith any reason for system rather than run?