3

The remote and local directories I've specified in my aliases files exist and are owned by my user (drush is run under my user).

$aliases['dev'] = array(
 'parent' => '@parent',
 'site' => 'mysite',
 'env' => 'dev',
 //[user, host, ssh options, etc.]
 'path-aliases' => array(
    '%files' => 'sites/default/disk',
    '%dump-dir' => '/home/joe/drush-backups/mysite_dev',
    ),
);    

$aliases['local'] = array(
 'parent' => '@parent',
 'site' => 'mysite',
 //[root]
 'path-aliases' => array(
     '%files' => 'sites/default/files',
     '%dump-dir' => '/Users/joe/Sites/mysite/tmp',
    ),
);

Yet I get a warning on sql-sync:

drush -v sql-sync @dev @local Loaded alias @local from file /Users/joe/.drush/soa.aliases.drushrc.php
[notice] Loaded alias @dev from file /Users/joe/.drush/soa.aliases.drushrc.php
[notice] Local sql cache file does not exist.
[notice] ssh -i "/Users/joe/.ssh/id_rsa" -p "6421" joe@arch-web-p01.its.utexas.edu 'drush --backend=2 --root=/var/www/html/dev sql-query '\''SHOW TABLES'\'' 2>&1' 2>&1 [notice] WARNING: Using temporary files to store and transfer sql-dump. It is recommended that you specify --source-dump and --target-dump options on the command line, or set '%dump' or '%dump-dir' in the path-aliases section of your site alias records. This facilitates fast file transfer via rsync.

You will destroy data in drupal_test and replace with data from server/mysite_dev.

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

And if I continue, I get an error that indicates drush was trying to write to a different directory.

Do you really want to continue? (y/n): y Calling system(ssh -i "/Users/joe/.ssh/id_rsa" -p "6421" joe@server 'mysqldump --result-file /private/var/folders/mr/c99kf6c11_bdsr62m242c59c0000gq/T/mysite_dev1WyWuk --no-autocommit --single-transaction --opt -Q mysite_dev --host=myhost --user=mysite_dev --password='\''[pw]'\'' --skip-extended-insert --order-by-primary 2>&1'); mysqldump: Can't create/write to file '/private/var/folders/mr/c99kf6c11_bdsr62m242c59c0000gq/T/mysite_dev1WyWuk' (Errcode: 2) Database dump failed
[error] Command dispatch complete
[notice]

I've got all my drush commands working between remote directories run on the site. I am able to rsync between local and remote directories since specifying files path aliases in aliases.drushrc.php.

What am I missing? I have the latest version of drush in both places, so I don't think I need the patch pointed to at How do I set the drush tmp directory?...

  • I did not try to reproduce your issue, but I think this might be a recent issue in Drush, possibly a duplicate of github.com/drush-ops/drush/issues/321. If you are using 6.2.0, try on 6.0.0. In any event, what you are doing above looks correct. – greg_1_anderson Dec 17 '13 at 21:50
  • Hmm. So actually I'm using 6.0-rc2, installed with brew. – Beatrice Dec 17 '13 at 22:35
4

FWIW, I finally resolved the error by including the --source-dump option in the command line. I specified the same directory I had listed in my aliases file, and it created the dump file there flawlessly. So perhaps dump-dir is not being read in 6.0-rc2...

  • 1
    I still see the same problem in Drush 8.1.2. – Ken Williams Aug 6 '16 at 4:09
3

I solved the same error. When you specify %dump-dir, you also must specify the %dump variable, then it works:

'path-aliases' => array(
  '%dump-dir' => '/home/tmp',
  '%dump' => '/home/tmp/dump.sql',
),
  • made no difference on drush 8.1.9 – 2pha Jan 23 '17 at 8:15
0

dump-dir and dump options were remove somewhere in version 7.x https://github.com/drush-ops/drush/commit/df3980062a89436a26db20097363da69616cbb9c

You can still find it in 6.x branch but not in 8.x https://github.com/drush-ops/drush/blob/6.x/examples/example.aliases.drushrc.php

In issue https://github.com/drush-ops/drush/issues/1495 you can read:

markcarver: What happened to drush_sql_dump_file()?

weitzman: The feature is gone. sql-sync does not keep around transferred dump files any more.

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.