|Project:||Backup and Migrate|
Backup migrate has an error when it tries to back up a CiviCRM database. In my setup the CiviCRM database is a separate database to the Drupal default database. I've added the CiviCRM DB credentials in the settings.php file in the proper way.
When I run Backup Migrate on my CiviCRM database I get the following error:
Notice: Undefined index: create table in _get_table_structure_sql() (line 295 of [redacted] /www/sites/all/modules/backup_migrate/includes/destinations.db.mysql.inc).
I believe the problem is because CiviCRM has created a couple of MySQL views and these are confusing the code in includes/destinations.db.mysql.inc
The code in question (around line 295):
$out .= strtr($create['create table'], array("\n" => ' ', '"' => '`'));
Looking at the $create array, in the case of a MySQL view, there is no index 'create table', rather it is 'create view'.
With this in mind, I wonder about the wisdom of using Backup Migrate to move a CiviCRM database intance, as I assume that the MySQL views are required for correct operation.
In this case I'm going to use the command line too mysqldump to migrate my CiviCRM database, so that I am confident that the MySQL views are created correctly on the destination server.
Perhaps a solution would be an error message warning the user that Backup Migrate does not support migrating MySQL views, and that the user should use a different migration strategy.