You are here

function backup_migrate_restore in Backup and Migrate 5

Same name and namespace in other branches
  1. 6 backup_migrate.module \backup_migrate_restore()

The restore/import upload form.

1 string reference to 'backup_migrate_restore'
backup_migrate_menu in ./backup_migrate.module
Implementation of hook_menu().

File

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

Code

function backup_migrate_restore() {
  $form = array();
  $form['backup_migrate_restore_upload'] = array(
    '#title' => t('Upload a Backup File'),
    '#type' => 'file',
    '#description' => t("Upload a backup file created by this version of this module. For other database backups please use another tool for import. Max file size: %size", array(
      "%size" => format_size(file_upload_max_size()),
    )),
  );
  $form[] = array(
    '#type' => 'markup',
    '#value' => t('<p>This will delete some or all of your data and cannot be undone. If there is a sessions table in the backup file, you and all other currently logged in users will be logged out. <strong>Always test your backups on a non-production server!</strong></p>'),
  );
  $form[] = array(
    '#type' => 'submit',
    '#value' => t('Restore Database'),
  );
  if (user_access('access backup files')) {
    $form[] = array(
      '#type' => 'markup',
      '#value' => t('<p>Or you can restore one of the files in the <a href="!url">saved backup directory.</a></p>', array(
        "!url" => url("admin/content/backup_migrate/files"),
      )),
    );
  }
  $form['#attributes'] = array(
    'enctype' => 'multipart/form-data',
  );
  return $form;
}