Join Tom Geller for an in-depth discussion in this video Keep Drupal up to date, part of Drupal 8 Essentials 1: Getting Started.
- View Offline
- [Voiceover] As with any other software, people sometimes discover flaws in Drupal that can make it unstable or even vulnerable to attacks. Fortunately the Drupal community updates Drupal and its modules frequently but their work only does you good if you download and apply the fixed software regularly. To demonstrate, I've installed an obsolete version of Drupal 8 along with an obsolete module. One thing to notice is that you get no warning of this just by going to the front page or looking around the site.
Where you do see warnings is if you go up to either the Appearance or Extend links here. In this case we get two warnings. One that there's an update for Drupal itself and another warning about the modules or themes. We can see what's out of date by clicking these links, available updates. Or if you ever want to check on your own without this link available, simply go up to Reports and Available updates. They both go to the same place. Now there's some debate about whether you should update core Drupal or Modules first in a situation like this.
In earlier versions of Drupal, the recommended procedure was to update modules and themes first but in Drupal 8 the file structure has changed in a way that makes me recommend updating core Drupal first. To do that we'll go to our file system. In this case it's this obsolete folder. Now, before we do anything else, I'm going to back up that folder as well as the database that drives our Drupal site. In both Mac and Windows, you can simply copy and paste. This may take a while. Now we back up the database. To do that we go to Acquia Dev Desktop, then click the link next to Local database.
From here click Export and Go. Then save it. When I go back to my file system, I see there's my database and my copy of the site. Now for the scary part: updating Drupal Core. For this you have to explicitly replace the files and then put the sites, themes, modules, and profiles folders back in place. Your site basically lives in these four folders. In most cases you actually only need to deal with the sites folder, but this is really the most thorough way to do it.
To get the latest version, we go back to our site. Once there we notice that there's a Download link next to the Drupal core warning. We click it and Save the file. Then we go back to our file system and expand it. Now for the scary part. I'm going to throw away our original site, obsolete, and I'm going to rename the new copy of Drupal, the one that's up to date, obsolete. Basically it's taking the place of the old version. Now I'll open up obsolete copy and take those four folders.
That's modules, profiles, sites, and themes. I'll copy those and paste them inside this new obsolete. That will replace those folders that actually exist there now. Yup, I want to Replace everything. This may take a while. Now I go back to my site and reload this page. And there we are. Where before we had a warning, we now have a check mark showing that it's up to date. Now there's one more thing that I recommend you do even if Drupal doesn't tell you to.
Go up to your URL bar here and replace everything after your site's domain name or the basically the base URL and type in update.php. This it telling Drupal to update the database to match the new files because sometimes the database structure changes. It gives us a warning to back up the code and I've already done that and I say, sure, Continue. In this case, the database didn't need to be updated. If it had, we would have been given messages here saying exactly what changed. Now let's go back and take care of that module.
Once again we go to Reports and then Available updates and indeed we see the Token module needs an update. This one's a lot easier. All we have to do is go to Update. We check the box for the module that we want to update and if there's a whole bunch, you can just check this box up here and it checks all of the ones below it. Say Download these updates and wait a minute. Now it's going to apply these updates and I want to point out this Perform updates with site in maintenance mode.
That's going to actually turn off your site for a moment and if all goes well, it'll turn it back on but it doesn't always work, so I'll show you how to fix that if it doesn't. Click Continue. There. Update was completed successfully but again, it tells us to run the database updates. You could do that again by typing update.php or just clicking here. We get the same warning, we say Continue, and we're done. We go back to our front page and here we actually get a warning saying that we're operating in maintenance mode.
If I were to go to this site as a visitor, I'd just get a warning saying that the site's offline. So we have to explicitly go online if for some reason Drupal didn't get us back online once we were done updating. Just click the link and uncheck this box and Save configuration. By the way, if you ever want to go there directly, it's under Configuration and then scroll down a bit, and Maintenance mode. Your Drupal site is now up to date.
The procedure is basically the same on a Windows or a Linux computer except that of course you'll move files using the tools that those operating systems provide but inside Drupal's own interface on the web browser, it's exactly the same.
This course is the first of the series. No prerequisites are required beyond basic computer skills! These easy-to-follow tutorials show how to install Drupal and other necessary components on a Windows or Mac computer, navigate Drupal's web-based interface, configure the settings of a new Drupal site, create content, and move the site to a server. Every step includes best practices to ensure your website remains streamlined, secure, and up-to-date.
Watch Drupal 8 Essentials 2: Building Out Your Website to find out how to finesse your site with categories, comments, custom styles, and other special features.
- Comparing Drupal to other software
- Getting help with Drupal
- Installing Acquia Dev Desktop on Mac and Windows
- Installing the Drupal database, modules, and themes
- Creating basic content
- Establishing your site's look and feel
- Adjusting security settings
- Adding images and metadata
- Adding a sidebar
- Moving your Drupal website to a server
- Backing up a Drupal site