I've recently made some backup scripts to automate backup of my site and databases. One of the scripts uses drush to dump the drupal and civicrm databases with these commands:
drush @myserveralias cc all && drush @myserveralias sql-dump --gzip --result-file=mydrupaldatabase-150731.sql drush @myserveralias cc all && drush @myserveralias civicrm-sql-dump --gzip --result-file=mycivicrmdatabase-150731.sql
My problem is that both of them dumps the drupal database - I would like the second one to dump the civi-database.
Should i somehow specify the civicrm database? My aliases.drushrc.php doesn't specify anything about databases under myserveralis - should it be specified there? My settings.php has this to say about databases:
$databases['default']['default'] = array( 'driver' => 'mysql', 'database' => 'drupal', 'username' => 'myusername', 'password' => 'mypassword', 'host' => 'localhost', 'port' => 3306, 'prefix' => 'drupal_', 'collation' => 'utf8_general_ci', ); $databases['default']['default']['prefix']= array( 'default' => 'drupal_', 'civicrm_acl' => '`civicrm`.', 'civicrm_acl_cache' => '`civicrm`.', 'civicrm_acl_contact_cache' => '`civicrm`.', 'civicrm_acl_entity_role' => '`civicrm`.', ...
Thanks in advance for any help.
EDIT: I've updated drush to version 7.0.0, and the call to civicrm-sql-dump now fails with the following error:
PHP Fatal error: Call to undefined function drush_sql_dump_execute() in /sites/all/modules/civicrm/drupal/drush/civicrm.drush.inc on line 995
I guess there's no longer a function in Drush called drush_sql_dump_execute.
SECOND EDIT: I've updated to civicrm 4.6.8 and now it works as it should. I didn't get the chance to explore Alan's suggestions, though i know for sure that my civi-database is in a different database than Drupal. Thanks for your help and input. If anyone drops by here having this problem, I would recommend upgrading, as Jon says he hasn't seen this error in any of the newer versions of civi, and upgrading solved it for me. Leaving this open for now, if someone actually solves this for civi 4.4 and Drush 6, then they can provide an answer.