Project

General

Profile

Migrating D8CiviCRM to Pantheon » History » Revision 2

Revision 1 (Jon Goldberg, 12/27/2019 07:22 PM) → Revision 2/4 (Jon Goldberg, 01/23/2020 09:52 PM)

# Migrating D8/CiviCRM to Pantheon 

 I ran into a lot of trouble migrating an existing D8/Civi site to Pantheon.    There are too many were several reasons, including: 
 * Pantheon expects the `vendor` directory to be in the `web` directory; the typical D8/Civi install prohibits this. 
 * Enough changes to the typical D8/Civi setup that it doesn't pay to try to migrate. 

 Instead, it makes sense to get a Pantheon site up and running, then simply copy your the database over. 

 First, follow these directions, which should give you a working D8 site: 
 https://pantheon.io/docs/guides/drupal-8-composer-no-ci 

 Then do this: 
 * [I had to add `web_docroot: true` to `pantheon.yml` but I can't remember when that happens.] 
 * Edit `composer.json`; add all the missing modules from your existing site (including CiviCRM and Roundearth) in the "require" section. 
 * Also: `"minimum-stability": "dev",` and `config.platform.php` should be 7.1.9999 (or higher, if not using TFA module) 
 * Run `composer update`. 
 * You must also remove submodules and `.git` folders.    Pantheon doesn't support submodules, and the *presence* of a `.git` folder makes Pantheon think it's a submodule, and it won't deploy any code in that folder.    So run: `find . -mindepth 2 -type d    -name \*.git` to find all directories that need deleting.    You can alsu use `find . -mindepth 2 -type d    -name \*.git -exec rm -rf '{}' \;` to auto-remove them (be careful!). 
  * If you DID commit any .git directories, you need to either a) revert, remove .git, re-commit, or b) move the folders (e.g. `mv webform webform2`), commit *that*, then move it back. 
 * Copy your extensions into the extensions folder set in civicrm.settings.php.    Be sure to remove any `.git` folders here as well. 
 * set Pantheon site to git mode, and `git push`. 
 * Copy `civicrm.settings.php` from my [civicrm.settings.php for D8 on Pantheon gist](https://gist.github.com/MegaphoneJon/fb452df532565ce4b35f81221c9638d9) here (will provide file shortly) to `sites/default`.    Change the `%%sitekey%%` to something reasonable; also compare to your existing civicrm.settings.php (e.g. for profcond settings, overrides, etc.),    Also change the `$civicrm_root`: 
   -    $civicrm_root = '/srv/bindings/' . $pantheon_conf['pantheon_binding'] . '/code/sites/all/modules/civicrm'; 
   +    $civicrm_root = '/srv/bindings/' . $pantheon_conf['pantheon_binding'] . '/code/vendor/civicrm/civicrm-core'; 
 * Remove the `packages/` and `bower_components` lines from the `.gitignore` in `vendor/civicrm/civicrm-core`. 
 * Import your existing Drupal/Civi database.    They should be a single database dump, even if they were previously separate (since Pantheon won't support that).