Project

General

Profile

Actions

{{last_updated_at}} by {{last_updated_by}}

Migrating D8/CiviCRM to Pantheon

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.

Instead, it makes sense to get a Pantheon site up and running, then copy your 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 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).

WordPress

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 for folks to download.

Updated by Jon Goldberg over 3 years ago · 4 revisions