You are here

function backup_migrate_perform_backup in Backup and Migrate 5.0.x

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

Back up a source to 1 or more destinations.

Parameters

string $source_id:

string|array $destination_id:

array $config:

2 calls to backup_migrate_perform_backup()
BackupMigrateAdvancedBackupForm::submitForm in src/Form/BackupMigrateAdvancedBackupForm.php
Form submission handler.
BackupMigrateQuickBackupForm::submitForm in src/Form/BackupMigrateQuickBackupForm.php
Form submission handler.

File

./backup_migrate.module, line 40
Primary hook implementations for Backup Migrate.

Code

function backup_migrate_perform_backup($source_id, $destination_id, array $config = []) {
  try {

    // Retrieve the service.
    $bam = backup_migrate_get_service_object($config);

    // Run the backup.
    $bam
      ->backup($source_id, $destination_id);
    \Drupal::messenger()
      ->addMessage(t('Backup Complete.'));
  } catch (Exception $e) {
    \Drupal::messenger()
      ->addMessage($e
      ->getMessage(), 'error');
  }
}