1

I'm working with a prod and staging environment where the MySQL binaries (like mysqldump) are not installed. PHP can interact with MySQL just fine, but for reasons that are not relevant, the binaries aren't installed.

It appears that when performing an sql-sync, drush will attempt to ssh into the remote server, run the dump, then rsync the file down, then import it. Is there a way to avoid this, maybe a way of telling Drush to perform all the database operations locally? My workstation has access to the remote databases, so it is capable of performing mysql imports and dumps on the remote databases.

I understand that Drush cannot account for all edge cases like this. I wonder if anyone knows if there are workarounds for this or suggestions? I can just write my own scripts to do the syncing of databases, but would love to leverage drush.

2

Drush version 3 and onward (via the sql-sync command) can only copy the database via the ssh + mysql executable method that you describe above. If you download drush 2.1 (https://drupal.org/node/614830), you will find a command drush sql-load that works as you describe. It's a lot slower than sql-sync, so if your database is very large, you might find this technique to be too cumbersome. If it works for you, though, it probably wouldn't be very hard to make your own external Drush commandfile to provide sql-load on a more recent version of Drush.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.