Site Building

13.7. Updating a Theme for Drupal 8, 9, and 10

Goal

Update a contributed theme on your site and run the Database Updates script.

Site prerequisites

Steps

Sprout Video

You can use the administrative interface to update a contributed theme. If you are updating a custom theme rather than a contributed theme, if you see a message saying Installing modules and themes requires FTP access to your server, or if the steps below do not work to obtain the new theme files, follow the steps in Section 11.6, “Manually Downloading Module or Theme Files”, and then continue with step 5 in the instructions for administrative interface below.

If you are using Composer to manage the files in your site, follow the steps in Section 3.5, “Using Composer to Download and Update Files” to update the files, then continue here with step 6 in the instructions for the administrative interface below.

Using the administrative interface

  1. Put your site in maintenance mode. See Section 11.2, “Enabling and Disabling Maintenance Mode”.
  2. In the Manage administrative menu, navigate to Reports > Available updates > Update (admin/reports/updates/update).
  3. Find and check the theme in the list. Click Download these updates for the theme.

    Image
    Available updates

  4. Click Continue.
  5. Click Run database updates. If you obtained the new theme files manually, start with this step, and reach the database updates page by typing the URL example.com/update.php in your browser.
  6. Click Continue to run the updates. The database update scripts will be executed.
  7. Click Administration pages to return to the administration section of your site.
  8. Take your site out of maintenance mode. See Section 11.2, “Enabling and Disabling Maintenance Mode”.
  9. Clear the Drupal cache (refer to Section 12.2, “Clearing the Cache”).

Expand your understanding