Upgrade the Code
From the local Drupal site's directory, use Terminus to retrieve the existing site's Git URL:
terminus connection:info $D8_SITE.dev --field=git_url
Add the existing site as a remote repository called
existing
. Use the URL retrieved in the previous step:git remote add existing ssh://[email protected]:2222/~/repository.git git fetch existing
Copy over exported configuration from the original site. From your Drupal site, run the following commands:
This is a common location for the config file; if this isn't where your config file is located, replace 'config' with the full path, such as
web/sites/default/config
.git checkout existing-8/master -- config git mv config/* config/ git commit -m "Add site configuration."
git checkout existing-8/master -- sites/default/config git mv sites/default/config/* config/ git commit -m "Add site configuration."
Compare your current
pantheon.yml
file with the new drupalpantheon.upstream.yml
:git diff existing-8/master:pantheon.yml pantheon.upstream.yml
If you have customizations in your existing site's
pantheon.yml
that you want to keep for Drupal (e.g., a Quicksilver script or site-specific protected web paths), copypantheon.yml
over:git checkout existing-8/master -- pantheon.yml git commit -m "Update pantheon.yml."
Copy over any Quicksilver scripts referenced in
pantheon.yml
:git checkout existing-8/master -- private/scripts git commit -m "Add Quicksilver scripts."
git checkout existing-8/master -- private/scripts git commit -m "Add Quicksilver scripts."
List contrib modules and themes on your existing site:
terminus drush $D8_SITE.dev pm:projectinfo -- --fields=name,version --format=table
The command
pm:projectinfo
assumes Drush 8. If you encounter an issue with this command, verify and configure the Drush version before you continue.Use Composer on your new site to add these there:
composer require drupal/ctools:^3.4 drupal/redirect:^1.6 drupal/token:^1.7 git add composer.* git commit -m "Add contrib projects."
Copy over any custom modules or themes from your existing site:
git checkout master modules/custom git mv modules/custom web/modules/ git commit -m "Copy custom modules"
Check
settings.php
for any customizations to copy over:git status # Ensure working tree is clean git show master:sites/default/settings.php > web/sites/default/original-settings.php diff -Nup --ignore-all-space web/sites/default/settings.php web/sites/default/original-settings.php # edit web/sites/default/settings.php and commit as needed rm web/sites/default/original-settings.php
Copy your files and database from your existing site to the new site:
terminus site:clone $D8_SITE.live $DRUPAL_SITE.dev --no-code --no-destination-backup --no-source-backup
Info:NoteThe Site Clone plugin must be installed to use the
terminus site:clone
command. Visit https://github.com/pantheon-systems/terminus-site-clone-plugin for details on installing the Site Clone plugin.Push the new codebase from your local machine up to Pantheon:
terminus connection:set $DRUPAL_SITE.dev git git push origin master
Run database updates:
terminus drush $DRUPAL_SITE.dev -- updatedb