Migrating D8CiviCRM to Pantheon » History » Version 1
Jon Goldberg, 12/27/2019 07:22 PM
1 | 1 | Jon Goldberg | # Migrating D8/CiviCRM to Pantheon |
---|---|---|---|
2 | |||
3 | I ran into a lot of trouble migrating an existing D8/Civi site to Pantheon. There were several reasons, including: |
||
4 | * Pantheon expects the `vendor` directory to be in the `web` directory; the typical D8/Civi install prohibits this. |
||
5 | * Enough changes to the typical D8/Civi setup that it doesn't pay to try to migrate. |
||
6 | |||
7 | Instead, it makes sense to get a Pantheon site up and running, then simply copy the database over. |
||
8 | |||
9 | First, follow these directions, which should give you a working D8 site: |
||
10 | https://pantheon.io/docs/guides/drupal-8-composer-no-ci |
||
11 | |||
12 | Then do this: |
||
13 | * Edit `composer.json`; add all the missing modules from your existing site (including CiviCRM and Roundearth) in the "require" section. |
||
14 | * Also: `"minimum-stability": "dev",` and `config.platform.php` should be 7.1.9999 (or higher, if not using TFA module) |
||
15 | * Run `composer update`. |
||
16 | * 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!). |
||
17 | * 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. |
||
18 | * Copy your extensions into the extensions folder set in civicrm.settings.php. Be sure to remove any `.git` folders here as well. |
||
19 | * set Pantheon site to git mode, and `git push`. |
||
20 | * Copy `civicrm.settings.php` from 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`: |
||
21 | - $civicrm_root = '/srv/bindings/' . $pantheon_conf['pantheon_binding'] . '/code/sites/all/modules/civicrm'; |
||
22 | + $civicrm_root = '/srv/bindings/' . $pantheon_conf['pantheon_binding'] . '/code/vendor/civicrm/civicrm-core'; |
||
23 | * Remove the `packages/` and `bower_components` lines from the `.gitignore` in `vendor/civicrm/civicrm-core`. |
||
24 | * 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). |