Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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).
Comment | File | Size | Author |
---|---|---|---|
#9 | migrate-civi-values-1282200-9.patch | 5.75 KB | sfyn |
#8 | migrate-civi-values-1282200-8.patch | 6.15 KB | sfyn |
#6 | migrate-civi-values-1282200-6.patch | 3.84 KB | sfyn |
Comments
Comment #1
bgm CreditAttribution: bgm commentedRelated to #955018: ability to save new arbitrary data to a context from outside the service
Comment #2
j0nathan CreditAttribution: j0nathan commentedSubscribing.
Comment #3
sfyn CreditAttribution: sfyn commentedOne 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.
Comment #4
sfyn CreditAttribution: sfyn commentedFun 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.
Comment #5
sfyn CreditAttribution: sfyn commentedI 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.
Comment #6
sfyn CreditAttribution: sfyn commentedI 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.
Comment #7
sfyn CreditAttribution: sfyn commentedI have also documented my approach in #955018: ability to save new arbitrary data to a context from outside the service
Comment #8
sfyn CreditAttribution: sfyn commentedHere's a better patch that also addresses some of the code this makes redundant in the verify hooks.
Comment #9
sfyn CreditAttribution: sfyn commentedOK, here is the patch I think we should use. I was able to remove about 10 lines of unnecessary code.
Comment #10
bgm CreditAttribution: bgm commentedImpressive, thank you!
Tested and committed to 6.x-1.x.