archive-restore's --db-url flag does not seem to work for Drupal 7 restores. I'm not sure whether this is intended. The help documentation states:

--db-url                              A Drupal 6 style database URL indicating the target for    
                                           database restore. If not provided, the archived            
                                           settings.php is used.             

This suggests to me that a D6 style MYSQL connection string should be used when entering the command, but it isn't clear whether this will be parsed into a D7 db array for D7 sites.

If the --db-url is intended for D6 installations only, then the help text should be more clear. If it is supposed to work for D7, then this is a bug. It currently just appends this to the end of the settings.php file in D7:

// Appended by drush archive-restore command.

$db_url = 'mysql://user:pw@server/dbname';

Comments

juampynr’s picture

Issue summary: View changes

clarified wording

juampynr’s picture

Priority: Normal » Major
Status: Active » Needs review
StatusFileSize
new1.34 KB

The logic at archive-restore is incomplete. Here is a patch against master branch that solves the issue by:

  • Providing to drush_drupal_major_version() the root path of the project that we are restoring.
  • Formatting the appended database connection array with var_export(). If this is not done the result is just 'Array'. Single quotes surrounding it were removed too.
  • Alerting the user that this connection array was appended to settings.php and the old one was not removed, so it can lead to confusion if the old configuration is not removed.
  • Added a confirmation message at the end like the one that archive-dump has.
moshe weitzman’s picture

Status: Needs review » Fixed

Committed to master and 4.x ... Reduced log msg from a warning to an 'ok'

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

fixed typos