WordPress and Drupal Core Updates
Detailed information on applying and debugging upstream updates from Pantheon or a Custom Upstream.
Pantheon maintains core upstream repositories for WordPress, Drupal 8, and Drupal 7 which act as a parent repository to site repositories. Updates made by Pantheon in the core upstream repository, in addition to updates made by maintainers of Custom Upstreams, become available downstream as a one-click update.
Apply one-click updates to individual sites repositories using the Site Dashboard on Pantheon, via Terminus, or manually from the command line. Do not update core using the WordPress Dashboard, Drush, or WP-CLI; you will overwrite your core. For additional details, see Scope of Support.
Sites managing core with Composer are not compatible with Pantheon's One-click updates and must update core using Composer exclusively. For instructions, see Build Tools or Drupal 8 and Composer on Pantheon Without Continuous Integration.
Apply Upstream Updates via the Site Dashboard
Navigate to the Code tab in the Site Dashboard on the Dev environment to check available updates:
If you have SFTP changes you want to commit and deploy, do so now. Then set the site's connection mode to Git.
- Select whether you want to automatically resolve conflicts. Drupal users can opt to run
update.phpafter updates are applied.
- Click Apply Updates.
- Click Visit Development Site in the Development Environment to test and QA the site.
- Follow the standard Pantheon Workflow to deploy changes up to Test and on to Live.
In the event that the update fails, you may see an error indicating a conflict with some files in core. Try the "Auto-Resolve" option when applying updates. Pantheon will try to automatically resolve conflicts in favor of the upstream Git repository. This does not solve all problems that may arise, but it should take care of most situations.
If the "Auto-Resolve Conflicts" option fails, the next step is to manually pull your changes in using Git, resolve the conflicts, and then push the update up to your Pantheon site. This does not solve all problems that may arise, but it should take care of most situations.
Apply Upstream Updates via Terminus
If you prefer using the command line, you can apply updates with Terminus.
Update a Specific Site
terminus upstream:updates:apply site.env --updatedb
env with your site name and the correct environment. Learn more about this command by running
terminus help upstream:updates:apply.
Update Multiple Sites
For details, see Terminus Mass Update Plugin.
Apply Upstream Updates Manually from the Command Line to Resolve Merge Conflicts
If the automated core update doesn't appear to be working, it's possible there are conflicts with your codebase in the update. You can resolve by overwriting your CMS core with the upstream, or attempt a manual merge conflict resolution.
If you receive the error that you have conflicts while updating core, the fastest resolution is often the
-Xtheirs flag. This will attempt to automatically resolve the conflicts with a preference for upstream changes and is safe to run if you don't have your own changes in any of the conflicting files (e.g. problems with
This process can potentially cause loss of data. Be sure you have no custom code in your CMS core before proceeding.
git pull -Xtheirs git://github.com/pantheon-systems/drops-8.git master # resolve conflicts git push origin master
git pull -Xtheirs git://github.com/pantheon-systems/drops-7.git master # resolve conflicts git push origin master
git pull -Xtheirs git://github.com/pantheon-systems/drops-6.git master # resolve conflicts git push origin master
git pull -Xtheirs git://github.com/pantheon-systems/WordPress.git master # resolve conflicts git push origin master
Double-check the files before going forward to make sure no bugs were introduced.
If this procedure fails with the message
Already up to date. refer to this troubleshooting section to reset your git repository.
Merge Conflict Resolution
This process let's you manually resolve the conflict using the command line and a text editor.
git remote add pantheon-wordpress git://github.com/pantheon-systems/WordPress.git
git remote add pantheon-drops-8 git://github.com/pantheon-systems/drops-8.git
git remote add pantheon-drops-7 git://github.com/pantheon-systems/drops-7.git
Replace the remote name (
custom-upstream-example) and repository URL (
git://github.com/example-org/custom-upsream-example.git) with values specific to your existing Custom Upstream:
git remote add custom-upstream-example git://github.com/example-org/custom-upsream-example.git
Pull down changes from the appropriate upstream:
git fetch pantheon-wordpress git rebase pantheon-wordpress/master
git fetch pantheon-drops-8 git rebase pantheon-drops-8/master
git fetch pantheon-drops-7 git rebase pantheon-drops-7/master
Replace the remote name (
git fetch custom-upstream-example git rebase custom-upstream-example/master
If a conflict is introduced, use the output provided to resolve. For example:
git rebase pantheon-wordpress/master First, rewinding head to replay your work on top of it... Applying: Adjust rendering of version release notes Using index info to reconstruct a base tree... M wp-admin/about.php Falling back to patching base and 3-way merge... Auto-merging wp-admin/about.php CONFLICT (content): Merge conflict in wp-admin/about.php error: Failed to merge in the changes. Patch failed at 0001 Adjust rendering of version release notes The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem, run "git rebase --continue". If you prefer to skip this patch, run "git rebase --skip" instead. To check out the original branch and stop rebasing, run "git rebase --abort".
In this example, you would open
wp-admin/about.phpin your preferred text editor.
Then look for the conflict markers starting with
<<<<<<< HEADand manually edit the file to merge changes between Pantheon's upstream (shown first between
=======) and changes made downstream in the Custom Upstream repository (shown second between
>>>>>>> Adjust rendering of version release notes).
Delete the conflict markers and double-check the changes.
git statusto see conflicting files in the current index again. Once all conflicts have been addressed, you can add them to your index and continue pulling in updates:
git add . git rebase --continue
Push updates to the Site Dashboard on Pantheon:
git push origin master
Core Release Updates
Whenever there's a new release of WordPress or Drupal core, updates will be available within 72 hours of upstream availability. Security related updates will be made available within 24 hours.
One-Click Updates Do Not Appear After Rewriting Git History
Squashing and rewriting history may cause one-click updates to break, meaning updates will no longer appear on your Site Dashboard once available. Instead of using squash and rebase to clean up commits from merges occurring upstream, we recommend reviewing history locally with
git log --first-parent. This provides the same history shown on the Site Dashboard and prevents conflicts with our one-click updates.
If you are in a situation where you've altered the commit history in such a way that the dashboard is no longer able to determine if your site is up to date with the upstream, the simplest course of corrective action is to use
git reset --hard to reset the site repository to the last known good commit before the squash/rebase/revert was applied. This will result in losing all changes that have happened since this commit. You will need to re-apply all custom/contributed code updates that occurred in the interim, so make sure to take stock of these changes first and develop a plan to reapply them with the fixed Git history.
One-Click Update Not Appearing for Sites Using a Custom Upstream
Core updates for Custom Upstreams are initiated by the repository maintainer, not Pantheon. Please report issues directly to the project maintainer for expected updates.
It's important to relay the need for updating core to maintainers, even if you plan on manually pulling in core version updates. First, file an issue in the queue of your repository and reach out to a maintainer. Even better - submit a pull request for the update.
Once you have communicated the issue, you can manually apply updates from the command line.
Custom Upstream Updates Not Available
If you know your site's Custom Upstream has updated code, but it's not visible on your Site Dashboard, click on Check now:
This will trigger a "Code Cache Clear" to verify that the Site Dashboard has fetched the most recent commit. Please note that even after the workflow completes, it may take up to a minute before updates appear on the dashboard.
If updates are still not showing on the site, it may be necessary to re-set the site's upstream via Terminus. Please note that only the Site Owner or owning Organization Administrators can change a site's upstream.
503 Errors When Running Update.php and Installing Modules
There are multiple reasons that 503 errors might occur when updating:
PHP segfault: These are tricky to troubleshoot because very little debugging information is present. A temporary fix is available. Contact Pantheon Customer Support if you think you have been affected.
Timeouts are another cause of 503 errors, though they are much less likely to occur if you are using the Pantheon domains. If the operation takes more than 60 seconds, you might see a timeout occur.