You are here

function backup_migrate_db_backup in Backup and Migrate 5.2

Same name and namespace in other branches
  1. 8.2 includes/db.inc \backup_migrate_db_backup()

Build the database dump file. Takes a list of tables to exclude and some formatting options.

1 call to backup_migrate_db_backup()
backup_migrate_perform_backup in ./backup_migrate.module
Perform a backup with the given settings.

File

includes/db.inc, line 38
General database dump/restore code for Backup and Migrate.

Code

function backup_migrate_db_backup($source, $file, &$settings) {
  $settings['filename'] .= ".sql";
  $settings['filemime'] = 'text/x-sql';

  // Switch to a different db if specified.
  _backup_migrate_db_switch_db(_backup_migrate_destination_glue_url($source, FALSE));

  // Dump the database.
  $success = _backup_migrate_get_dump_sql($file, $settings['exclude_tables'], $settings['nodata_tables']);

  // Switch back to the previous db.
  _backup_migrate_db_switch_db();
  return $success ? $file : FALSE;
}