Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Under drush 7.x-4.5, the following command worked well for backing up the site database:
drush @site sql-dump --result-file --gzip
where @site was defined in .drush/aliases.drushrc.php as:
$aliases['site'] = array(
'uri' => 'example.com',
'root' => '/var/www/html/drupal',
);
After replacing drush 7.x-4.5 with drush 7.x-5.0, an error occurred after running the above command:
[user@example.com ~]$ drush @site sql-dump --result-file --gzip
Unknown engine type version-control [error]
No path was set for including the version-control engine backup. [error]
PHP Fatal error: Call to a member function prepare_backup_dir() on a non-object in /home/example.com/drush/commands/sql/sql.drush.inc on line 345
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Call to a member function prepare_backup_dir() on a non-object
in /home/example.com/drush/commands/sql/sql.drush.inc, line 345
Any ideas?
Comments
Comment #1
davidd07 CreditAttribution: davidd07 commentedI am also getting the same thing happening.
Comment #2
davidd07 CreditAttribution: davidd07 commentedOk will point out it works when you enter a file name.
eg drush @local sql-dump --result-file=test.sql
However the automatic file name method seems to be no longer working.Comment #3
simon_s CreditAttribution: simon_s commentedThe automatic file name method was quite handy. Please repair. :)
Comment #4
DamienMcKennaI got this error when I forgot to enter an equals sign between the "--result-file" argument and the filename, which suggests a bug in the logic controlling the --result-file argument.
Comment #5
moshe weitzman CreditAttribution: moshe weitzman commentedFixed in 0fefe87. Underscore instead of dash
Comment #6
waverate CreditAttribution: waverate commentedMoshe,
Thank you for looking into this. How do we find the patch?
Comment #7
moshe weitzman CreditAttribution: moshe weitzman commentedSorry, my push had failed. It is pushed now. You can download latest from git or grab patch from http://drupalcode.org/project/drush.git
Comment #8
waverate CreditAttribution: waverate commentedConfirmed fixed.