Project

General

Profile

Migrating D8CiviCRM to Pantheon » History » Version 4

Jon Goldberg, 11/09/2020 07:38 PM

1 4 Jon Goldberg
{{last_updated_at}} by {{last_updated_by}}
2
3 1 Jon Goldberg
# Migrating D8/CiviCRM to Pantheon
4
5 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.
6 1 Jon Goldberg
7 2 Jon Goldberg
Instead, it makes sense to get a Pantheon site up and running, then copy your database over.
8 1 Jon Goldberg
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 2 Jon Goldberg
* [I had to add `web_docroot: true` to `pantheon.yml` but I can't remember when that happens.]
14 1 Jon Goldberg
* Edit `composer.json`; add all the missing modules from your existing site (including CiviCRM and Roundearth) in the "require" section.
15
* Also: `"minimum-stability": "dev",` and `config.platform.php` should be 7.1.9999 (or higher, if not using TFA module)
16
* Run `composer update`.
17
* 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!).
18
 * 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.
19
* Copy your extensions into the extensions folder set in civicrm.settings.php.  Be sure to remove any `.git` folders here as well.
20
* set Pantheon site to git mode, and `git push`.
21 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`:
22 1 Jon Goldberg
  -  $civicrm_root = '/srv/bindings/' . $pantheon_conf['pantheon_binding'] . '/code/sites/all/modules/civicrm';
23
  +  $civicrm_root = '/srv/bindings/' . $pantheon_conf['pantheon_binding'] . '/code/vendor/civicrm/civicrm-core';
24
* Remove the `packages/` and `bower_components` lines from the `.gitignore` in `vendor/civicrm/civicrm-core`.
25
* 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).
26 3 Jon Goldberg
27
28
### WordPress
29
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.