I'm not sure when this started being a problem, but using drush 4.4 and Aegir 1.3 (also happens in Aegir 1.0), the site_key and civicron_password/username are lost after a migration to another platform.

Also, strangely, running verify on the site will not fix the problem. It will attempt to create a new site_key, but will not store it in drushrc.php. Seems like drushrc.php is not updated on verify (which would be surprising).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bgm’s picture

j0nathan’s picture

Subscribing.

sfyn’s picture

One possibility to work around the limitations of #955018: ability to save new arbitrary data to a context from outside the service:

Write to a seperate file (call it provision.civicrm.settings.php) with the missing data - then we just need to make sure this file is bootstrapped to provide the civicrm data instead of the drushrc - we lose the dependancy on drushrc.

sfyn’s picture

Fun fact, during my tests today I have noticed that the $options['civicrm_sitekey'] and the $options['site_civicrm'] are conserved through migration, but appear at the bottom of the drushrc.php file instead of at the top - just before the block assigning $options to the $_SERVER superglobal.

I think this happens because at line 82 of drush_civicrm_post_provision_verify you set the sitekey again.

sfyn’s picture

Status: Needs review » Active

I have been attempting to pass these values, and have had some success.

The problem is that when drushrc is written for the site, the values don't get written. So, uh, wuh? Just wanted to make sure others could see what I have tried to do on this.

sfyn’s picture

Status: Active » Needs review
FileSize
3.84 KB

I have a working patch for this functionality.

What I did was look at how the migrate function does it's business, and made use of provision_backend_invoke to invoke an additional verify after the migration completes to reinstate the values that will have been lost in the meantime. This is possible because the post_provision_migrate and pre_provision_migrate hooks occupy the same drush context.

sfyn’s picture

sfyn’s picture

Here's a better patch that also addresses some of the code this makes redundant in the verify hooks.

sfyn’s picture

OK, here is the patch I think we should use. I was able to remove about 10 lines of unnecessary code.

bgm’s picture

Status: Needs review » Fixed

Impressive, thank you!
Tested and committed to 6.x-1.x.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.