Pantheon.io Workflow Explained
<div id=""><h2 id="intro">Intro<a href="#intro" aria-label="intro permalink" class="custom-class after"><svg aria-hidden="true" height="20" version="1.1" viewbox="0 0 16 16" width="20"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"/></svg></a></h2> <p><strong>This tutorial assumes that you understand the <a href="/posts/git-guide/" style="color: inherit; text-decoration: none;" name="readabilityLink-1">basics of GIT</a> and <a href="/posts/wordpress-data-structure-in-database-vs-not-in-database/" style="color: inherit; text-decoration: none;" name="readabilityLink-2">WordPress File Structure</a><a href="#readabilityFootnoteLink-1" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[1]</sup></small></a><a href="#readabilityFootnoteLink-2" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[2]</sup></small></a></strong></p> <p><a href="https://pantheon.io/" style="color: inherit; text-decoration: none;" name="readabilityLink-3">Pantheon.io</a><a href="#readabilityFootnoteLink-3" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[3]</sup></small></a> is a webhost that specializes in WordPress and Drupal hosting, but also allows for GIT version control. It is a happy medium between good hosts like Siteground or WPEngine that are excellent hosts, but don’t allow you to easily clone the site with GIT, and the big enterprise solutions like AWS that can only be worked with very advanced users. Pantheon is excellent and easy to use, but you do need to take a bit of time to understand their workflow. When you understand it completely you can work with it in the correct way and save yourself some headaches (or panic attacks) in the future. At its core you need to understand <strong>2 main concepts</strong>:</p> <ol> <li><strong>Your site has 3 environments</strong></li> <li><strong>Your site has 3 types of Data</strong></li> </ol> <p>First you will want to understand the 3 types of Data, and make sure that you understand which of these 3 buckets each part of your site falls in to.</p> <h2 id="3-data-types">3 Data Types<a href="#3-data-types" aria-label="3 data types permalink" class="custom-class after"><svg aria-hidden="true" height="20" version="1.1" viewbox="0 0 16 16" width="20"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"/></svg></a></h2> <p><span class="gatsby-resp-image-wrapper"> <a class="gatsby-resp-image-link" href="/static/506f1795b8858ff5e601bace761ea3a0/040c5/1.jpg" target="blank" rel="noopener"> <span class="gatsby-resp-image-background-image"/> <img class="gatsby-resp-image-image" alt="3 Data Types" title="3 Data Types" src="/static/506f1795b8858ff5e601bace761ea3a0/b1bff/1.jpg" srcset="/static/506f1795b8858ff5e601bace761ea3a0/8c497/1.jpg 200w, /static/506f1795b8858ff5e601bace761ea3a0/39ca7/1.jpg 400w, /static/506f1795b8858ff5e601bace761ea3a0/b1bff/1.jpg 800w, /static/506f1795b8858ff5e601bace761ea3a0/040c5/1.jpg 1200w" sizes="(max-width: 800px) 100vw, 800px" loading="lazy"/> </a> </span></p> <p>It is important to understand these three Data types because you will be moving each of the three independently in different directions. Either Upstream or Downstream between your environments. You need to know which direction each type of data should flow, and therefore need to know exactly what is included in each of these data types. The Files datatype had me confused at first because I tend to think of files as site files, like code. But when Pantheon refers to Files they are talking about media uploads like images. Make sure you remember this. Code and Database are straightforward. If you have worked with WordPress in the past you should know what is included in the Database, this is not unique to Pantheon. In short:</p> <ul> <li><strong>Code</strong> is all the files under GIT control</li> <li><strong>Files + Database</strong> is the site content and is NOT GIT controlled.</li> </ul> <p>You will be pushing these three types of data around your three environments:</p> <h2 id="3-environments">3 Environments<a href="#3-environments" aria-label="3 environments permalink" class="custom-class after"><svg aria-hidden="true" height="20" version="1.1" viewbox="0 0 16 16" width="20"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"/></svg></a></h2> <p><span class="gatsby-resp-image-wrapper"> <a class="gatsby-resp-image-link" href="/static/7fe28d9df2cc8ca0395a29c211d4dbdf/d1b73/2.png" target="blank" rel="noopener"> <span class="gatsby-resp-image-background-image"/> <img class="gatsby-resp-image-image" alt="Pantheon.io dashboard showing the 3 available environments of a Pantheon site." title="Pantheon.io dashboard showing the 3 available environments of a Pantheon site." src="/static/7fe28d9df2cc8ca0395a29c211d4dbdf/d1b73/2.png" srcset="/static/7fe28d9df2cc8ca0395a29c211d4dbdf/59afc/2.png 200w, /static/7fe28d9df2cc8ca0395a29c211d4dbdf/a45af/2.png 400w, /static/7fe28d9df2cc8ca0395a29c211d4dbdf/d1b73/2.png 768w" sizes="(max-width: 768px) 100vw, 768px" loading="lazy"/> </a> </span></p> <p><span class="gatsby-resp-image-wrapper"> <a class="gatsby-resp-image-link" href="/static/25007018c12793150aa47fbd056aaefa/040c5/3.jpg" target="blank" rel="noopener"> <span class="gatsby-resp-image-background-image"/> <img class="gatsby-resp-image-image" alt="3 environments diagram, dev test and live" title="3 environments diagram, dev test and live" src="/static/25007018c12793150aa47fbd056aaefa/b1bff/3.jpg" srcset="/static/25007018c12793150aa47fbd056aaefa/8c497/3.jpg 200w, /static/25007018c12793150aa47fbd056aaefa/39ca7/3.jpg 400w, /static/25007018c12793150aa47fbd056aaefa/b1bff/3.jpg 800w, /static/25007018c12793150aa47fbd056aaefa/040c5/3.jpg 1200w" sizes="(max-width: 800px) 100vw, 800px" loading="lazy"/> </a> </span></p> <p>The <strong>Dev</strong> site is where you will be able to GIT Clone, and Push your Code. From there you will push the code upstream to take effect on the other environments. You can also periodically pull down the Files and Database from the Test and Live environments so the Dev site will look the same. I have some notes about Pushing code changes but first lets take a look at a data flow diagram so that this is all very clear:</p> <h2 id="data-flow">Data Flow<a href="#data-flow" aria-label="data flow permalink" class="custom-class after"><svg aria-hidden="true" height="20" version="1.1" viewbox="0 0 16 16" width="20"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"/></svg></a></h2> <p><span class="gatsby-resp-image-wrapper"> <a class="gatsby-resp-image-link" href="/static/9302bcef89423f187380433e768b4af2/040c5/4.jpg" target="blank" rel="noopener"> <span class="gatsby-resp-image-background-image"/> <img class="gatsby-resp-image-image" alt="data flow diagram, code goes up, files and database go down" title="data flow diagram, code goes up, files and database go down" src="/static/9302bcef89423f187380433e768b4af2/b1bff/4.jpg" srcset="/static/9302bcef89423f187380433e768b4af2/8c497/4.jpg 200w, /static/9302bcef89423f187380433e768b4af2/39ca7/4.jpg 400w, /static/9302bcef89423f187380433e768b4af2/b1bff/4.jpg 800w, /static/9302bcef89423f187380433e768b4af2/040c5/4.jpg 1200w" sizes="(max-width: 800px) 100vw, 800px" loading="lazy"/> </a> </span></p> <p>There are some things to take note of here. We can see that <strong>Code</strong> is flowing upstream in this diagram. You should note that <strong>Code</strong> can ONLY flow upstream, it is not possible to pull code changes back down. In fact making code changes on the Test and Live environments has been <strong>disabled</strong>. If you go to the <strong>Test</strong> site <strong>Dashboard>Plugins</strong> you will see that the option to install new plugins from the Dashboard has been removed. The <strong>Code</strong> flow is <strong>one way only</strong>.</p> <p><strong>Files + Database</strong> can go both ways. I can copy <strong>Files</strong> or <strong>Database</strong> in either direction independently. Obviously you are generally going to have the files and Database flowing downstream though. Why is that? If I am a developer and I am working on the <strong>Dev</strong> environment, doing my thing, making big changes; while I am doing that, database changes are happening on the live site. Orders are being placed, blog posts written, page content changed, photos uploaded etc. All of those things are <strong>Files + Database</strong> changes. If you take the Files and Database from the Dev site and Push it upstream, you will overwrite all of that important content. Remember that you CAN do this, and sometimes you must, but in general the Files and Database will be flowing downstream.</p> <p><span class="gatsby-resp-image-wrapper"> <a class="gatsby-resp-image-link" href="/static/6c03d6c8004d837123f35995c81a2a5a/65838/5.png" target="blank" rel="noopener"> <span class="gatsby-resp-image-background-image"/> <img class="gatsby-resp-image-image" alt="Pantheon Dashboard Database Management Tab" title="Pantheon Dashboard Database Management Tab" src="/static/6c03d6c8004d837123f35995c81a2a5a/acfc1/5.png" srcset="/static/6c03d6c8004d837123f35995c81a2a5a/59afc/5.png 200w, /static/6c03d6c8004d837123f35995c81a2a5a/a45af/5.png 400w, /static/6c03d6c8004d837123f35995c81a2a5a/acfc1/5.png 800w, /static/6c03d6c8004d837123f35995c81a2a5a/7dc98/5.png 1200w, /static/6c03d6c8004d837123f35995c81a2a5a/362ee/5.png 1600w, /static/6c03d6c8004d837123f35995c81a2a5a/65838/5.png 2050w" sizes="(max-width: 800px) 100vw, 800px" loading="lazy"/> </a> </span></p> <p>Ok, this is the part where we go into some specific tips, tricks and examples, <strong>so please make sure you completely understand what I have covered so far before you move on</strong>.</p> <h2 id="undoing-changes-and-commits">Undoing Changes and Commits<a href="#undoing-changes-and-commits" aria-label="undoing changes and commits permalink" class="custom-class after"><svg aria-hidden="true" height="20" version="1.1" viewbox="0 0 16 16" width="20"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"/></svg></a></h2> <p>It happens all the time, you commit a change to try something out, it doesn’t work and now we want to take a step back; how do we do that? While Pantheon gives you more options to control your site with GIT than anyone else, it is not without restrictions. For example you cannot use the <strong>GIT Reset</strong> function. What are the consequences of this? First lets briefly cover the difference between <strong>GIT Reset</strong> and <strong>GIT Revert</strong>.</p> <h3 id="revert-vs-reset">Revert vs Reset<a href="#revert-vs-reset" aria-label="revert vs reset permalink" class="custom-class after"><svg aria-hidden="true" height="20" version="1.1" viewbox="0 0 16 16" width="20"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"/></svg></a></h3> <p>Let us say that I have 5 commits in a row:</p> <table> <thead> <tr> <th>Commit#</th> <th>Commit Note</th> </tr> </thead> <tbody readability="3"> <tr readability="2"> <td>5</td> <td>Install Plugin: Revolution Slider</td> </tr> <tr> <td>4</td> <td>Update to WordPress 5.0</td> </tr> <tr readability="2"> <td>3</td> <td>Install Plugin: Yoast SEO</td> </tr> <tr readability="2"> <td>2</td> <td>Install Plugin: WooCommerce</td> </tr> <tr> <td>1</td> <td>Fresh Install</td> </tr> </tbody> </table> <p>So we have committed these 5 changes. Now if I <strong>Revert</strong> Commit #3, I will be undoing JUST that commit. I will be removing Yoast SEO, but I will still be on WordPress 5.0 and have Revolution Slider installed. However if I <strong>Reset</strong> to Commit #3, I am resetting the head of my branch to that location and undoing ALL of the changes that happened after that.</p> <p>You cannot <strong>Reset</strong> a Pantheon repo. If you do that on your local copy and try to push it to Pantheon you will be rejected and told that you are behind.</p> <p>For example if we have a string of commits here on the local repo and I want to go back to my fresh install of Jupiter 6 theme as shown here:</p> <p><span class="gatsby-resp-image-wrapper"> <a class="gatsby-resp-image-link" href="/static/35f1439716101a6c6ec820e5bef2a40c/7dc98/6.png" target="blank" rel="noopener"> <span class="gatsby-resp-image-background-image"/> <img class="gatsby-resp-image-image" alt="reset head to 7eb89fea" title="reset head to 7eb89fea" src="/static/35f1439716101a6c6ec820e5bef2a40c/acfc1/6.png" srcset="/static/35f1439716101a6c6ec820e5bef2a40c/59afc/6.png 200w, /static/35f1439716101a6c6ec820e5bef2a40c/a45af/6.png 400w, /static/35f1439716101a6c6ec820e5bef2a40c/acfc1/6.png 800w, /static/35f1439716101a6c6ec820e5bef2a40c/7dc98/6.png 1200w" sizes="(max-width: 800px) 100vw, 800px" loading="lazy"/> </a> </span></p> <p>I can do that locally, but when you then try to push that change to the remote pantheon repo you will get the following error message:</p> <p><span class="gatsby-resp-image-wrapper"> <a class="gatsby-resp-image-link" href="/static/ff74365f7f09ca3e7904ae50577220e6/4008b/7.png" target="blank" rel="noopener"> <span class="gatsby-resp-image-background-image"/> <img class="gatsby-resp-image-image" alt="can't execute git command" title="can't execute git command" src="/static/ff74365f7f09ca3e7904ae50577220e6/acfc1/7.png" srcset="/static/ff74365f7f09ca3e7904ae50577220e6/59afc/7.png 200w, /static/ff74365f7f09ca3e7904ae50577220e6/a45af/7.png 400w, /static/ff74365f7f09ca3e7904ae50577220e6/acfc1/7.png 800w, /static/ff74365f7f09ca3e7904ae50577220e6/4008b/7.png 994w" sizes="(max-width: 800px) 100vw, 800px" loading="lazy"/> </a> </span></p> <p>So how do we undo changes once they have been committed to our Dev site? The answer is <strong>Revert</strong>. When you <strong>Revert</strong> a commit you do not actually remove it from the tree. You are adding another commit, which means you will not be behind the remote repo and you will be able to safely push that change:</p> <p><span class="gatsby-resp-image-wrapper"> <a class="gatsby-resp-image-link" href="/static/a4f081a009e66de9e7321fab87b8393c/d1b73/8.png" target="blank" rel="noopener"> <span class="gatsby-resp-image-background-image"/> <img class="gatsby-resp-image-image" alt="revert commit" title="revert commit" src="/static/a4f081a009e66de9e7321fab87b8393c/d1b73/8.png" srcset="/static/a4f081a009e66de9e7321fab87b8393c/59afc/8.png 200w, /static/a4f081a009e66de9e7321fab87b8393c/a45af/8.png 400w, /static/a4f081a009e66de9e7321fab87b8393c/d1b73/8.png 768w" sizes="(max-width: 768px) 100vw, 768px" loading="lazy"/> </a> </span></p> <p>Here we have reverted the last commit, then we push our repo to the remote repository and on the Pantheon website we will see our changes being synced:</p> <p><span class="gatsby-resp-image-wrapper"> <a class="gatsby-resp-image-link" href="/static/562a053d68d89411f44df6de3002c7b9/d1b73/9.png" target="blank" rel="noopener"> <span class="gatsby-resp-image-background-image"/> <img class="gatsby-resp-image-image" alt="syncing code on dev" title="syncing code on dev" src="/static/562a053d68d89411f44df6de3002c7b9/d1b73/9.png" srcset="/static/562a053d68d89411f44df6de3002c7b9/59afc/9.png 200w, /static/562a053d68d89411f44df6de3002c7b9/a45af/9.png 400w, /static/562a053d68d89411f44df6de3002c7b9/d1b73/9.png 768w" sizes="(max-width: 768px) 100vw, 768px" loading="lazy"/> </a> </span></p> <p>And then we can check the Pantheon log and see that our changes have been pushed successfully:</p> <p><span class="gatsby-resp-image-wrapper"> <a class="gatsby-resp-image-link" href="/static/f9e0feb8d71bf94ea1f7a5fad7b7cbce/9a05d/10.png" target="blank" rel="noopener"> <span class="gatsby-resp-image-background-image"/> <img class="gatsby-resp-image-image" alt="revert in commit log" title="revert in commit log" src="/static/f9e0feb8d71bf94ea1f7a5fad7b7cbce/acfc1/10.png" srcset="/static/f9e0feb8d71bf94ea1f7a5fad7b7cbce/59afc/10.png 200w, /static/f9e0feb8d71bf94ea1f7a5fad7b7cbce/a45af/10.png 400w, /static/f9e0feb8d71bf94ea1f7a5fad7b7cbce/acfc1/10.png 800w, /static/f9e0feb8d71bf94ea1f7a5fad7b7cbce/7dc98/10.png 1200w, /static/f9e0feb8d71bf94ea1f7a5fad7b7cbce/362ee/10.png 1600w, /static/f9e0feb8d71bf94ea1f7a5fad7b7cbce/9a05d/10.png 1736w" sizes="(max-width: 800px) 100vw, 800px" loading="lazy"/> </a> </span></p> <h2 id="sftp-mode-vs-git-mode">SFTP Mode vs GIT Mode<a href="#sftp-mode-vs-git-mode" aria-label="sftp mode vs git mode permalink" class="custom-class after"><svg aria-hidden="true" height="20" version="1.1" viewbox="0 0 16 16" width="20"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"/></svg></a></h2> <p><span class="gatsby-resp-image-wrapper"> <a class="gatsby-resp-image-link" href="/static/4ff719c8c097b467784081d408964071/f5ac8/11.png" target="blank" rel="noopener"> <span class="gatsby-resp-image-background-image"/> <img class="gatsby-resp-image-image" alt="toggle between sftp mode and git mode" title="toggle between sftp mode and git mode" src="/static/4ff719c8c097b467784081d408964071/acfc1/11.png" srcset="/static/4ff719c8c097b467784081d408964071/59afc/11.png 200w, /static/4ff719c8c097b467784081d408964071/a45af/11.png 400w, /static/4ff719c8c097b467784081d408964071/acfc1/11.png 800w, /static/4ff719c8c097b467784081d408964071/7dc98/11.png 1200w, /static/4ff719c8c097b467784081d408964071/362ee/11.png 1600w, /static/4ff719c8c097b467784081d408964071/f5ac8/11.png 1720w" sizes="(max-width: 800px) 100vw, 800px" loading="lazy"/> </a> </span></p> <p>One of the nice features of the Pantheon Dev Environment is that you do not <strong>have</strong> to push all of your changes through GIT. You can connect via SFTP and make changes that way. Any changes that you make in SFTP mode will be consolidated into 1 commit when you switch back to GIT mode, which you can then pull down to your local repo. One of the nice things about working in SFTP mode is that you can install plugins directly through the WordPress dashboard. If you try to do this while you are in GIT mode the installation will fail because the sites file write permissions have been locked and cannot be written to while in GIT mode. You will be prompted for FTP credentials:</p> <p><span class="gatsby-resp-image-wrapper"> <a class="gatsby-resp-image-link" href="/static/aaab44ac898821e55cd3dcb9fb1f53da/d1b73/12.png" target="blank" rel="noopener"> <span class="gatsby-resp-image-background-image"/> <img class="gatsby-resp-image-image" alt="ftp credentials prompt" title="ftp credentials prompt" src="/static/aaab44ac898821e55cd3dcb9fb1f53da/d1b73/12.png" srcset="/static/aaab44ac898821e55cd3dcb9fb1f53da/59afc/12.png 200w, /static/aaab44ac898821e55cd3dcb9fb1f53da/a45af/12.png 400w, /static/aaab44ac898821e55cd3dcb9fb1f53da/d1b73/12.png 768w" sizes="(max-width: 768px) 100vw, 768px" loading="lazy"/> </a> </span></p> <p><strong>Spoiler Alert: nothing you put in here will work.</strong></p> <p>You will also be unable to update plugins that are already installed, or register plugins with confirmation codes. To do these things you will need to be in SFTP mode. This is the real trick that the other hosts have not figured out, the switching back and forth between these two modes. Pantheon does not do a good job of explaining this in their docs however.</p> <p>So just remember, if you are in the WordPress dashboard trying to install plugins, or register them, or update themes and its not working, <strong>you are probably in GIT mode when you should be in SFTP</strong>.</p> <h2 id="ignoring-update-nags">Ignoring Update Nags<a href="#ignoring-update-nags" aria-label="ignoring update nags permalink" class="custom-class after"><svg aria-hidden="true" height="20" version="1.1" viewbox="0 0 16 16" width="20"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"/></svg></a></h2> <p>One of the things that you will run into with Pantheon is the constant update nags, trying to get you to commit WordPress updates. They look like this:</p> <p><span class="gatsby-resp-image-wrapper"> <a class="gatsby-resp-image-link" href="/static/b2740de0b674282dbbf11123efe810a2/d1b73/13.png" target="_blank" rel="noopener"> <span class="gatsby-resp-image-background-image"/> <img class="gatsby-resp-image-image" alt="sample update nag" title="sample update nag" src="/static/b2740de0b674282dbbf11123efe810a2/d1b73/13.png" srcset="/static/b2740de0b674282dbbf11123efe810a2/59afc/13.png 200w, /static/b2740de0b674282dbbf11123efe810a2/a45af/13.png 400w, /static/b2740de0b674282dbbf11123efe810a2/d1b73/13.png 768w" sizes="(max-width: 768px) 100vw, 768px" loading="lazy"/> </a> </span></p> <p><strong>Do not accept these commits</strong>. Updating WordPress to the latest version immediately after it has been released is one of the all time greatest ways to break your site. You need to give your theme and plugin developers time to make compatibility updates and then install WordPress updates manually. The only people who would want to do this are people running very simple blogs with few plugins. If you are running an e-commerce site blindly applying these updates is a BIG NO NO.</p> <p>Just remember, you can keep applying your own code commits and doing what you need to do while completely ignoring these “nags” (That is what the Pantheon customer service guys call them).</p> <h2 id="bonus-question">Bonus Question<a href="#bonus-question" aria-label="bonus question permalink" class="custom-class after"><svg aria-hidden="true" height="20" version="1.1" viewbox="0 0 16 16" width="20"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"/></svg></a></h2> <p>Extra points now if you get this correct. Here is the scenario:</p> <p>“You have updated from WordPress 4.9 to 5.0 on the <strong>Dev</strong> site using a GIT commit. And then you committed those changes to the <strong>Test</strong> site. Oops, now you realized your mistake. None of your plugins or your version of WooCommerce are compatible with this massive WordPress update. We need to undo this change!”</p> <p>How do you go about this?</p> <p>If you answered “Use a <strong>revert</strong> to this commit on the <strong>Dev</strong> site and then push that change to the <strong>Test</strong> site” you are only half correct. In this case the big update to WordPress also made several changes to your <strong>database</strong>. To roll back those changes you will need to do more than just revert the code, you need to load a backup of your database or copy the database from the <strong>Live</strong> environment as well.</p> <p>That is a bit of a trick question but these are the things you need to think about.</p> <h2 id="conclusion">Conclusion<a href="#conclusion" aria-label="conclusion permalink" class="custom-class after"><svg aria-hidden="true" height="20" version="1.1" viewbox="0 0 16 16" width="20"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"/></svg></a></h2> <p>It seems like a lot to manage but once you have worked with it for a bit the workflow becomes very intuitive and convenient. You have the ability to track changes with GIT and work with a group, while at the same time getting a nice interface for less tech-savvy users. There are some other quirks that you will have to take care of if you are starting up with Pantheon. For example:</p> <ul> <li>There is no .htaccess files with Pantheon. So any re-directs need to be handled manually the wp-config.php file or by using a WordPress plugin.</li> <li>The standard WordPress email function does not work with Pantheon. You need to set up an SMTP server and connect to it. I prefer <a href="https://www.mailgun.com/" style="color: inherit; text-decoration: none;" name="readabilityLink-4">Mailgun</a><a href="#readabilityFootnoteLink-4" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[4]</sup></small></a>, and WordPress has a <a href="https://wordpress.org/plugins/wp-mail-smtp/" style="color: inherit; text-decoration: none;" name="readabilityLink-5">slick plugin</a><a href="#readabilityFootnoteLink-5" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[5]</sup></small></a> that integrates with them seamlessly.</li> <li>If you are migrating over an older site, you need to double check which version of PHP your Pantheon server is running. Odds are that your old site is running on an older version and you will be wondering why so many things are broken. <a href="https://pantheon.io/docs/php-versions/" style="color: inherit; text-decoration: none;" name="readabilityLink-6">You can force Pantheon to run an older version of PHP</a><a href="#readabilityFootnoteLink-6" class="readability-DoNotFootnote" style="color: inherit;"><small><sup>[6]</sup></small></a>.</li> </ul></div><div id="readability-footnotes"><h3>References</h3><ol id="readability-footnotes-list"><li><small><sup><a href="#readabilityLink-1" title="Jump to Link in Article">^</a></sup></small> <a href="/posts/git-guide/" name="readabilityFootnoteLink-1">basics of GIT</a></li><li><small><sup><a href="#readabilityLink-2" title="Jump to Link in Article">^</a></sup></small> <a href="/posts/wordpress-data-structure-in-database-vs-not-in-database/" name="readabilityFootnoteLink-2">WordPress File Structure</a></li><li><small><sup><a href="#readabilityLink-3" title="Jump to Link in Article">^</a></sup></small> <a href="https://pantheon.io/" name="readabilityFootnoteLink-3">Pantheon.io</a><small> (pantheon.io)</small></li><li><small><sup><a href="#readabilityLink-4" title="Jump to Link in Article">^</a></sup></small> <a href="https://www.mailgun.com/" name="readabilityFootnoteLink-4">Mailgun</a><small> (www.mailgun.com)</small></li><li><small><sup><a href="#readabilityLink-5" title="Jump to Link in Article">^</a></sup></small> <a href="https://wordpress.org/plugins/wp-mail-smtp/" name="readabilityFootnoteLink-5">slick plugin</a><small> (wordpress.org)</small></li><li><small><sup><a href="#readabilityLink-6" title="Jump to Link in Article">^</a></sup></small> <a href="https://pantheon.io/docs/php-versions/" name="readabilityFootnoteLink-6">You can force Pantheon to run an older version of PHP</a><small> (pantheon.io)</small></li></ol></div>