Commit 857912bc authored by Adrian Rossouw's avatar Adrian Rossouw

Change migrate behaviour when alpha 9 + is installed.

parent 1adadaf9
......@@ -5,6 +5,36 @@
*/
function drush_provision_hostmaster_migrate_validate($site, $platform) {
$data = drush_get_merged_options();
$alias_file = drush_server_home() . '/.drush/server_master.alias.drushrc.php';
// If the alias file exists, it means we are migrating from a post alpha9 release.
if (file_exists($alias_file)) {
provision_backend_invoke('@server_master', 'provision-verify');
provision_backend_invoke('@hostmaster', 'provision-verify');
drush_set_option('site_name', '@hostmaster');
drush_set_option('old_platform', d('@hostmaster')->platform);
$new_platform = '@platform_' . preg_replace("/[!\W]/", "", basename(rtrim($platform, '/')));
drush_backend_invoke_args("provision-save", array($new_platform), array(
'context_type' => 'platform',
'server' => '@server_master',
'web_server' => '@server_master',
'root' => $platform,
'makefile' => dirname(__FILE__) . '/aegir.make',
));
provision_backend_invoke($new_platform, 'provision-verify');
drush_set_option('new_platform', $new_platform);
// exit if an error has occured.
if (drush_get_error()) {
return false;
}
}
else {
// add a server record :
$server = '@server_master';
drush_backend_invoke_args("provision-save", array($server), array(
......@@ -74,8 +104,7 @@ function drush_provision_hostmaster_migrate_validate($site, $platform) {
if (drush_get_error()) {
return false;
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment