Project

General

Profile

Migrating D8CiviCRM to Pantheon » History » Version 3

Jon Goldberg, 09/16/2020 08:05 PM

1 1 Jon Goldberg
# Migrating D8/CiviCRM to Pantheon
2
3 2 Jon Goldberg
I ran into a lot of trouble migrating an existing D8/Civi site to Pantheon.  There are too many changes to the typical D8/Civi setup that it doesn't pay to try to migrate.
4 1 Jon Goldberg
5 2 Jon Goldberg
Instead, it makes sense to get a Pantheon site up and running, then copy your database over.
6 1 Jon Goldberg
7
First, follow these directions, which should give you a working D8 site:
8
https://pantheon.io/docs/guides/drupal-8-composer-no-ci
9
10
Then do this:
11 2 Jon Goldberg
* [I had to add `web_docroot: true` to `pantheon.yml` but I can't remember when that happens.]
12 1 Jon Goldberg
* Edit `composer.json`; add all the missing modules from your existing site (including CiviCRM and Roundearth) in the "require" section.
13
* Also: `"minimum-stability": "dev",` and `config.platform.php` should be 7.1.9999 (or higher, if not using TFA module)
14
* Run `composer update`.
15
* 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!).
16
 * 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.
17
* Copy your extensions into the extensions folder set in civicrm.settings.php.  Be sure to remove any `.git` folders here as well.
18
* set Pantheon site to git mode, and `git push`.
19 2 Jon Goldberg
* Copy `civicrm.settings.php` from my [civicrm.settings.php for D8 on Pantheon gist](https://gist.github.com/MegaphoneJon/fb452df532565ce4b35f81221c9638d9) 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`:
20 1 Jon Goldberg
  -  $civicrm_root = '/srv/bindings/' . $pantheon_conf['pantheon_binding'] . '/code/sites/all/modules/civicrm';
21
  +  $civicrm_root = '/srv/bindings/' . $pantheon_conf['pantheon_binding'] . '/code/vendor/civicrm/civicrm-core';
22
* Remove the `packages/` and `bower_components` lines from the `.gitignore` in `vendor/civicrm/civicrm-core`.
23
* 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).
24 3 Jon Goldberg
25
26
### WordPress
27
WordPress has a lot fewer issues (because there's no Composer), but you still need an alternative `civicrm.settings.php`.  I have one [in a repo](https://github.com/MegaphoneJon/civicrm-wp-pantheon) for folks to download.