drush sql-sync does not work

Description

If you use drush sql-sync prod test then:
if you are located in the test directory, you get the confirm message:
You will destroy data in drupal-test and replace with data from drupal-test.
if you are located in the production directory, you get the confirm message:
You will destroy data in drupal and replace with data from drupal.

Testing shows that this is not just a message construction error - things work as stated. ie if located in the test directory drush sql-sync prod test simple backups up test and reloads it.

The workaround is not to use drush sql-sync but instead mysqlsump the drupal database and then use mysql to restore the dump file into drupal-test.

The drush version command says that we are running 5.8 and that 5.9 is available. I suspect that we should update first before looking for other reasons for the error. Note that the drush version command says:

drush version 5.8
A newer version of drush, 7.x-5.9, is available. You are currently running drush version 5.8. The update process depends on how you installed drush. Some common update commands are: `pear upgrade drush/drush`, `git pull`, `drush dl drush --destination=/path/to/drush`.

Activity

Ben Charlton May 26, 2015 at 5:29 AM

Drush was upgrade to 6.5
the command drush –
sudo drush --source-dump=temp.sql sql-sync @prod @dev
worked as expected

It is important to set the temp file as well as use sudo as the user may not have permission to create the temp file.

Tim Gething May 26, 2015 at 5:22 AM

Ben - I have not seen this problem. However I always use the @ format - ie (copying from my putty session this morning)

admin@openvpms:~/wwwtest$ drush sql-sync @live @test

You will destroy data in drupal-test and replace with data from drupal.

You might want to make a backup first, using the sql-dump command.

Do you really want to continue? (y/n): y
admin@openvpms:~/wwwtest$

Fixed

Details

Assignee

Reporter

Priority

Who's Looking?

Open Who's Looking?

Created February 28, 2015 at 7:16 PM
Updated May 26, 2015 at 5:29 AM
Resolved May 26, 2015 at 5:29 AM
Who's Looking?