You are here

function backup_migrate_perform_restore in Backup and Migrate 5.2

Same name and namespace in other branches
  1. 8.4 backup_migrate.module \backup_migrate_perform_restore()
  2. 8.2 backup_migrate.module \backup_migrate_perform_restore()
  3. 8.3 backup_migrate.module \backup_migrate_perform_restore()
  4. 6.3 backup_migrate.module \backup_migrate_perform_restore()
  5. 6.2 backup_migrate.module \backup_migrate_perform_restore()
  6. 7.3 backup_migrate.module \backup_migrate_perform_restore()
  7. 7.2 backup_migrate.module \backup_migrate_perform_restore()
  8. 5.0.x backup_migrate.module \backup_migrate_perform_restore()

Restore from a file in the given destination.

2 calls to backup_migrate_perform_restore()
backup_migrate_ui_destination_restore_file_confirm_submit in includes/destinations.inc
Do the file restore.
backup_migrate_ui_manual_restore_form_submit in ./backup_migrate.module
The restore submit. Do the restore.

File

./backup_migrate.module, line 588
Create (manually or scheduled) and restore backups of your Drupal MySQL database with an option to exclude table data (e.g. cache_*)

Code

function backup_migrate_perform_restore($destination_id, $file_id) {
  require_once './' . drupal_get_path('module', 'backup_migrate') . '/includes/files.inc';

  // If not in 'safe mode', increase the maximum execution time:
  if (!ini_get('safe_mode') && ini_get('max_execution_time') < 600) {
    set_time_limit(600);
  }

  // Load the file from the destination.
  $file = backup_migrate_destination_get_file($destination_id, $file_id);
  if (!$file) {
    _backup_migrate_message("Could not restore because the file could not be loaded from the destination.", array(), 'error');
    backup_migrate_temp_file("", TRUE);
    return FALSE;
  }
  $file = backup_migrate_perform_restore_file($file);
  if (!$file) {
    _backup_migrate_message("Could not restore the database.", array(), 'error');
    backup_migrate_temp_file("", TRUE);
    return FALSE;
  }
  return $file;
}