[[security-update-theme]]

=== Updating a Theme

[role="summary"]
How to update a contributed theme by using the administrative interface and running the Database Updates script, or by using Drush.

(((Theme,updating)))
(((Security update,applying)))
(((Contributed theme,updating)))
(((Drush tool,using to update theme)))

==== Goal

Update a contributed theme on your site and run the _Database Updates_ script.

==== Was man wissen sollte

* <<security-concept>>
* <<security-cron-concept>>

==== Site prerequisites

* A contributed theme has been installed and there is an update available for
it. See <<extend-theme-install>> and <<security-announce>>.

* If your site is live, you should test this process in a development
environment before running it on your production site. See
<<install-dev-making>>.

* You have created a full site backup. See <<prevent-backups>>.

* If you want to use the user interface, the core Update Manager module must be
installed. See <<config-install>> for instructions on installing core
modules.

* If you want to use Drush, Drush must be installed. See <<install-tools>>.

==== Steps

You can use the administrative interface or Drush 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 <<extend-manual-install>>, and then continue with step 6 in
the instructions for administrative interface below.

===== Using the administrative interface

. Put your site in maintenance mode. See <<extend-maintenance>>.

. In the _Manage_ administrative menu, navigate to _Reports_ >
_Available updates_ > _Update_ (_admin/reports/updates/update_).

. Find and check the theme in the list. Click _Download these updates_ for the
theme.
+
--
// Update page for theme (admin/reports/updates/update).
image:images/security-update-theme-updates.png["Available updates",width="100%"]
--

. Click _Continue_.

. 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.

. Click _Continue_ to run the updates. The database update scripts will be
executed.

. Click _Administration pages_ to return to the administration Abschnitt of your
site.

. Take your site out of maintenance mode. See <<extend-maintenance>>.

. Clear the Drupal cache (refer to <<prevent-cache-clear>>).

===== Using Drush

. Find the project name for the theme you wish to update, which is the last
segment of the theme's project page URL. For example, if the project URL is
_https://www.drupal.org/project/mayo_, the project name is "mayo".

. Run the following Drush command, giving the project name (for example,
`mayo`) as a parameter:
+
----
drush up mayo
----

. Follow the instructions on the screen.

==== Expand your understanding

* Review the site log, see <<prevent-log>>, once the updates are complete to
check for errors.

* <<security-update-module>>

// ==== Related concepts

// ==== Additional resources


*Attributions*

Written by https://www.drupal.org/u/batigolix[Boris Doesborg].
