When the Drupal Security Team publishes an advisory that affects your site, the work lands on you. Drupal is open-source software that you host and maintain yourself, so nobody applies the fix on your behalf. This guide covers the mechanics of getting an urgent update live with the least risk: what is yours to handle, a quick backup, the update itself, checks afterwards, and a way back if it goes wrong.
What you control and what the project fixes
The Drupal Security Team and the maintainers of each module or theme write and release the fix. They announce it through the advisories listed at drupal.org/security. That is where their part ends.
Everything after that is yours, or your host’s if you pay for managed Drupal hosting:
- Knowing which core version and which contributed modules your site runs.
- Downloading the patched release and deploying it to your server.
- Running database updates and clearing caches.
- Testing that the site still works.
- Keeping a copy to restore if the update causes problems.
How much of this a host handles depends on your hosting plan and setup. Check what your provider actually does before assuming it covers updates. If your site still runs Drupal 7, note that it reached end of life on 5 January 2025, so it no longer gets regular fixes from the project. Moving to a supported major version is the real remedy there, not a quick patch.
Before you touch anything: read the advisory
Spend a few minutes on the advisory itself. It names the affected project, the releases that contain the fix, and a risk rating. Three questions decide how fast you move:
- Is the affected code installed on your site? A module that is present but disabled is a different situation from one that is enabled. The advisory and your module list tell you which.
- Which release do you need to reach? Note the exact fixed release, not just “the latest”.
- Does the advisory describe a workaround? Some advisories suggest a temporary mitigation, such as disabling a feature, while you prepare the update.
If your site is managed with Composer, running composer audit and the Drush command drush pm:security can also list installed packages that have known security releases. Treat them as a check, and confirm against the advisory.
Take a fast backup
A backup is what makes every later step reversible. You need two things: the database and the code. Files uploaded by users matter too, but they rarely change during an update.
- Database: run drush sql:dump and write the result to a file outside the web root, with a timestamp in its name.
- Code and configuration: if the project lives in Git, make sure everything is committed, including composer.json, composer.lock and your exported configuration. If it does not, copy the project directory.
- Uploaded files: copy the public files directory if it has changed since your last backup.
Many hosts also offer one-click snapshots. They are convenient, but confirm you can restore from one before you rely on it. A backup you have never restored is an assumption.
Apply the update, staging first when time allows
If you have a staging copy, use it. Pull the latest production database into staging, apply the update there, and run through the checks below. The whole cycle can take under an hour for a small site, and it catches the problems that are expensive on production.
When the risk rating is high and the site is exposed, you may have to go straight to production. That is acceptable if you have the backup from the previous step and a plan for rollback.
On a Composer-managed site the steps are the same in either place:
- Put the site in maintenance mode if the update could affect visitors, using the Drush command drush state:set system.maintenance_mode 1.
- Update only what the advisory names. For a module, run composer update drupal/module_name –with-dependencies. For core, update the core packages together, typically drupal/core-recommended, drupal/core-composer-scaffold and drupal/core-project-message.
- Check that composer.lock changed only in the packages you expected. A large unrelated diff means something else moved.
- Run database updates with drush updatedb.
- Import configuration if your workflow requires it, then run drush cache:rebuild.
- Turn maintenance mode off with drush state:set system.maintenance_mode 0.
Avoid bundling unrelated upgrades into an urgent fix. A security release is usually small; a major refactor of your dependencies is not. Keep the change as narrow as you can so that, if something breaks, you know what caused it. The wider update process is documented at drupal.org/docs.
If your site is not managed with Composer and you updated by replacing files by hand, the same order applies: code first, then database updates, then cache rebuild. Moving to a Composer workflow is worth doing when you have time, because it makes the next urgent update a single command.
Check the site afterwards
A site that loads its homepage is not necessarily a working site. Test the paths that earn or protect your business:
- The status report at Reports, then Status report, in the admin area. It flags pending database updates and missing requirements.
- The recent log messages page, for new PHP errors or warnings.
- Logging in and out as an editor and as a normal user.
- Creating and saving a piece of content, with an image upload.
- Your key forms, such as contact, checkout or sign-up, submitted end to end.
- Search, menus and any view that lists content.
- Pages as an anonymous visitor, to make sure caching and permissions still behave.
Confirm the fix landed by checking the installed version of the updated project against the release named in the advisory. The status report and the Composer lock file both show it.
Roll back if something breaks
Decide your rollback trigger before you start. A broken checkout, a white screen or errors on every page are good reasons to revert instead of debugging live.
- Switch maintenance mode on.
- Restore the previous code. With Git, that means checking out the previous commit and running composer install so the vendor directory matches the old lock file.
- Restore the database dump you took earlier. Database updates are not always reversible by themselves, so the dump is the reliable route.
- Run drush cache:rebuild and test the same paths again.
- Turn maintenance mode off.
Rolling back removes the fix, so the site is exposed again. Treat it as a pause, not a resolution. Work out what failed on staging, then reapply the update. In the meantime, apply any workaround the advisory offers.
Frequently asked questions
How quickly should you apply a Drupal security update?
As soon as you can do it safely. The advisory’s risk rating and whether the affected code is enabled on your site set the pace. A high-rated issue in an active module justifies moving the same day, while a low-rated one in a disabled module can wait for your normal maintenance window.
Do you need a staging site to update Drupal?
No, but it reduces risk. Staging lets you find a conflict with a custom module or theme without affecting visitors. If you have none, a verified backup and a written rollback plan are the minimum.
Will a security update change your content or settings?
Security releases are intended to fix a problem without altering how your site works, and your content stays in the database. Database updates may still run, and a patched module can behave slightly differently, so test your key pages and forms before you call the job done.