You are here

function backup_migrate_destination_db_save in Backup and Migrate 5.2

Databse save download destination callback.

1 string reference to 'backup_migrate_destination_db_save'
backup_migrate_backup_migrate_destination_types in includes/destinations.inc
Implementation of hook_backup_migrate_destination_types().

File

includes/destinations.db.inc, line 12
Functions to handle the direct to database destination.

Code

function backup_migrate_destination_db_save($destination, $file, $settings) {
  require_once './' . drupal_get_path('module', 'backup_migrate') . '/includes/files.inc';
  require_once './' . drupal_get_path('module', 'backup_migrate') . '/includes/db.inc';

  // Switch to the new db.
  _backup_migrate_db_switch_db(_backup_migrate_destination_glue_url($destination, FALSE));

  // Restore the file to the db.
  backup_migrate_perform_restore_file(backup_migrate_file_info($file));

  // Switch back to the old db.
  _backup_migrate_db_switch_db();
  return $file;
}