Choose one: Manual updates for Backdrop CMS, or the Pantheon upstream

One of the benefits of hosting a website on Pantheon, is that the dashboard can notify you when there are available updates for the core code of your CMS (Backdrop CMS, Drupal, or WordPress).

Pantheon does this by comparing the code you are running on your own website, to the latest available code in the matching Pantheon "upstream". For Backdrop CMS websites, the Pantheon "upstream" is the backdrop-pantheon repository on GitHub.

When your Pantheon dashboard shows that there are updates available for your site, it has noticed that your code is no longer identical to the code located there.

The yellow Apply Updates button on the Pantheon dashboard.

When you click the “Apply Updates” button on the Pantheon dashboard, it will attempt to pull the most recent code from the upstream, and overwrite what you are using for your site.

If you have made any substantial changes to your code, Pantheon’s self-update will fail.

Failure message on the Pantheon dashboard.

You can make “substantial changes” to your core code accidentally, when you do a “manual update” from the Backdrop Administrative Interface. This feature is available from the top of the available updates page, when you have enabled the Project Installer module.

The Install System Updates link at the top of the available updates page.

Using the Backdrop CMS administrative interface to update your site will replace all the core code Pantheon provided, with the core code available from a packaged release of Backdrop CMS.

The most significant difference between the code in a packaged release, and the code for the same version of Backdrop in the Pantheon upstream, is the additional release information that is added to all the .info files.

In order to get your version of Backdrop back in sync with Pantheon, the easiest thing to do is pull down the latest tag from the backdrop-pantheon repository, and overwrite your code.

I do that by adding the backdrop-pantheon repository as a remote for my local git checkout, and pull the upstream changes, as follows:

git remote add github git@github.com:backdrop-ops/backdrop-pantheon.git
git pull github master -X theirs

Using the -X theirs flag tells Git to use the backdrop-pantheon version when there’s a merge conflict. This might still result in a few issues that need to be resolved (like files that had been deleted in recent updates) but it will be far easier than needing to resolve each conflict yourself!

Once you have confirmed that there are no other conflicts, commit the changes locally, and push your code back up to Pantheon.

git commit -m “Restore codebase to pantheon upstream”
git push origin master

(Yes, unfortunately, Pantheon still forces everyone to use the branch name “master”. I’ve heard a rumor that they know about the problem this causes for many organizations, and might, someday, choose to work on a fix.)

This should restore the pantheon dashboard to its previous “happy” state:

Pantheon dashboard showing no updates available.

You should choose only one way to manage your core code. You can either use the pantheon upstream, or you can use the built-in core update feature in Backdrop. Both are valid options.

If you prefer to use the manual update feature from within Backdrop, it is recommended that you do not use the Backdrop upstream in Pantheon to avoid any confusion. If you are still using both, and would like to get the notices on your Pantheon dashboard to go away, this tutorial should help you! :)

© 2024 Jeneration Web Development