migrate.hostmaster.inc 1.58 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
<?php

/**
 * @file manual site migrate system
 */

function drush_provision_hostmaster_migrate_validate($site, $platform) {
  // verify the target platform:
  $data = drush_get_merged_options(); // XXX: necessary because the remote
                                      // platform may not have been
                                      // initialised by the frontend (this
                                      // should be checked instead)
  $data['root'] = $platform;
  $data['r'] = $platform;
  drush_backend_invoke('provision verify', $data);
  // verify the current platform
  drush_backend_invoke('provision verify', array('root' => drush_get_option(array('r', 'root'), drush_locate_root())));
  // verify the site prior to migration
  drush_backend_invoke('provision verify', array($site));
}

function drush_provision_pre_hostmaster_migrate($site, $platform) {
  drush_backend_invoke('hostmaster park', array($site, 'uri' => $site));
}

function drush_provision_hostmaster_migrate($site, $platform) { 
  drush_backend_invoke('provision clone', array($site, $site, $platform));
}

function drush_provision_hostmaster_migrate_rollback($site, $platform) {
  drush_backend_invoke('provision delete ', array($site, 'root' => $platform));
}

function drush_provision_post_hostmaster_migrate($site, $platform) {
  drush_backend_invoke('hostmaster unpark', array($site, 'uri' => $site, 'root' => $platform));
  if (!drush_get_error()) {
    drush_backend_invoke('provision delete', array($site));
    drush_backend_invoke('provision verify', array($site, 'root' => $platform, 'publish_path' => $platform));
  }
}