function drush_upgrade_site_upgrade_validate

3.x upgrade.drush.inc drush_upgrade_site_upgrade_validate($target_key = NULL)
4.x upgrade.drush.inc drush_upgrade_site_upgrade_validate($target_key = NULL)

Do some sanity checks to make sure that we are ready to perform an upgrade, and that the command is being called with reasonable-looking parameters.

File

commands/core/upgrade.drush.inc, line 77
Refine your Drupal major version upgrade.

Code

function drush_upgrade_site_upgrade_validate($target_key = NULL) {
  if (empty($target_key)) {
    return drush_set_error('DRUSH_UPGRADE_NO_TARGET', dt('Missing argument: target'));
  }

  if (!$target_alias = drush_sitealias_get_record($target_key)) {
    return drush_set_error('DRUSH_UPGRADE_NO_TARGET', dt('Site alias not found: @target-key. See example.drushrc.php.', array('@target-key' => $target_key)));
  }

  if (!file_exists(dirname($target_alias['root']))) {
    drush_set_error('DRUSH_UPGRADE_NO_TARGET', dt('Parent directory for site alias root not found: @root; this folder must exist before running site-upgrade. See example.drushrc.php.', array('@root' => dirname($target_alias['root']))));
  }

  if (realpath($target_alias['root']) == realpath(DRUPAL_ROOT)) {
    drush_set_error('DRUSH_UPGRADE_NO_TARGET', dt('Target site alias must have a different Drupal root directory than the source site.  Both are at @root.', array('@root' => $target_alias['root'])));
  }
}