Right now, migrate is marked as a "dangerous" task for sites running the hostmaster profile, and are therefore forbidden.

We now have a (rather hackish) way of upgrading hostmaster sites through the provision-hostmaster-migrate command in the backend. We should therefore be able to upgrade the site through the frontend, somehow.

Cloning is still a no go, i think, but we should consider it, especially with #500362: dispatcher locking.

CommentFileSizeAuthor
#6 allow_upgrade_of-711746-6.patch2.9 KBhelmo
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

adrian’s picture

we can only do this once we have the queue out of hostmaster.

adrian’s picture

Priority: Normal » Minor
Steven Jones’s picture

Status: Active » Postponed
clemens.tolboom’s picture

Version: 6.x-0.4-alpha3 » 7.x-3.x-dev
Issue summary: View changes

If this is done it should be in HEAD

ergonlogic’s picture

Closed #454312: self-provisionning support as a duplicate of this issue.

helmo’s picture

Status: Postponed » Needs work
FileSize
2.9 KB

Here's a first stab at this, currently adding it to hosting_tasks_extra but could be just as well to the hosting module.

It adds a new task type to just the hostmaster site which in the backend triggers the existing hostmaster-migrate code.

TODO:

  • cleanup the form, and add config options?
    • directory name
    • makefile option
    • working copy option
    • Version? stable or dev
  • Warn about or handle the queued losing it's database
ergonlogic’s picture

Neat! So, just to be clear, updating Provision would still be a manual process? FWIW, the more of the back-end code that we move into front-end drush/ dirs, the fewer updates to Provision will be required.

helmo’s picture

Yes, updating provision is out of scope here. When installed as Debian package we don't even have write access to those files.

ergonlogic’s picture

Right, so how do we handle an upgrade where the backend needs an update too? It seems like we could pretty easily get ourselves in pretty serious trouble. Might there be some way, in hostmaster-migrate presumably, to flag that the new platform requires an upgrade to Provision, and fails gracefully? Does hosting.drush.inc get bootstrapped on a verify of the hostmaster platform? Maybe something like this could work:

 # in provision.drush.inc

/**
 * Return the current version of Provision.
 */
function provision_version() {
  return file_get_contents('VERSION');
}
 # in hosting.drush.inc

define('HOSTING_MINIMUM_PROVISION_VERSION', '3.5');

/**
 * Implements hook_drush_init().
 */
function hosting_drush_init() {
  if (version_compare(provision_version(), HOSTING_MINIMUM_PROVISION_VERSION) < 0)) {
    drush_set_error('HOSTING_MINIMUM_PROVISION_VERSION', 'This version of Hosting requires an upgrade to Provision before proceeding.');
  }
}
helmo’s picture

Adding such a version check sounds like a good idea.

I'm not sure that the new platform is bootstrapped early enough...

drush_provision_hostmaster_migrate_validate calls provision-verify on the new platform which calls drush make. So I guess we could add some checking code at the end of that function.

ergonlogic’s picture

hosting_drush_init()

wouldn't be bootstrapped at the platform level. However, maybe we can add the minimum Provision version to sites/all/drush/drushrc.php, since that'd make it easy to access. For example, this works:

$ drush @platform_hostmaster eval "drush_print_r(drush_get_option('profiles'));"
Array
(
    [0] => minimal
    [1] => standard
    [2] => hostmaster
)
helmo’s picture

#2648450: hosting_queued fails to restart itself seems to have now solved the queued part.