--- restore.provision.inc 29 sep 2009 20:49:34 -0400 1.11 +++ restore.provision.inc 30 sep 2009 22:07:46 -0400 @@ -44,17 +44,18 @@ dt("Removed dump file @path after restoring from it"), dt("Could not remove dump file @path"), 'DRUSH_PERM_ERROR'); - $db_grant_host = _provision_mysql_grant_host( + if (!drush_get_option('db_name', null, 'site') == drush_get_option('db_name')) { + $db_grant_host = _provision_mysql_grant_host( drush_get_option('db_host', '', 'site'), drush_get_option('web_ip', null, 'site'), drush_get_option('web_host', null, 'site')); - // We have now completed successfully, remove the old database. - _provision_mysql_destroy_site_db( - drush_get_option('db_name', null, 'site'), - drush_get_option('db_user', null, 'site'), - drush_get_option('db_passwd', null, 'site'), - $db_grant_host); - + // We have now completed successfully, remove the old database. + _provision_mysql_destroy_site_db( + drush_get_option('db_name', null, 'site'), + drush_get_option('db_user', null, 'site'), + drush_get_option('db_passwd', null, 'site'), + $db_grant_host); + } // The new database credentials will be saved against the site now. drush_set_option('db_name', drush_get_option('db_name'), 'site'); drush_set_option('db_type', drush_get_option('db_type'), 'site');