Editorial illustration; commands are examples and must be adapted to the site’s Composer project.
“Just run Composer update” is how Drupal sites end up with a half-applied core release, a broken composer.lock, and a status report that disagrees with the packages installed in vendor/. A safe Drupal core patch or minor update is not a single command—it is a short, repeatable chain: verify what the project actually uses, capture a restorable backup, resolve dependencies locally, test real user paths, and deploy the exact lock file to production.
This workflow covers routine patch and minor updates within a supported major Drupal release (for example, 10.3.x to 10.3.y or 10.4.x). Major-version jumps require module compatibility audits, deprecated-API fixes, and dedicated migration testing, so never treat a major upgrade as a quick maintenance window patch.
Check the Composer package setup and current health
Before touching composer.json or composer.lock, open your local copy of the repository and check whether the site uses drupal/core-recommended or drupal/core, and whether custom patches are managed via cweagans/composer-patches. Most modern Drupal templates use drupal/core-recommended, which pins core’s transitive dependencies (like Symfony and Twig) to versions tested by the Drupal security team.
Run a quick baseline check locally:
composer show drupal/core-recommended
composer outdated "drupal/*"
composer audit
Read the release notes and security advisories for the target version before running any update. At the same time, check /admin/reports/status on the live or staging site. Fixing a missing PHP extension, a failing cron job, or a dirty configuration state before updating core saves you from guessing whether the update caused it. Note down your current Git commit, PHP version, Drush version, and database engine so you have a clean baseline.
Back up the database and uploaded files first
composer.lock and Git can rebuild your PHP codebase, but they cannot bring back user-uploaded media or database content if a hook_update_N() script fails halfway through. Always take a fresh database dump and archive web/sites/default/files (or your configured files directory) outside the release folder before deploying:
drush sql:dump --gzip --result-file=../backups/pre-update-$(date +%F).sql
If the site uses exported configuration (config/sync), verify drush config:status is clean before you start. Having uncommitted or unexported config changes sitting in the live database when you run a core update is a common source of headaches during deployment.
Resolve and inspect the update locally
Never run composer update directly on a production server. Resolving dependencies on production risks running out of memory, pulling a slightly different dependency tree than what you tested, or leaving vendor/ in an inconsistent state if the command aborts.
On your local machine, update core and its dependencies together:
composer update "drupal/core-*" --with-all-dependencies
Once Composer finishes, inspect git diff composer.json composer.lock carefully. Pay attention to what changed besides drupal/core: did Symfony, Doctrine, or Guzzle bump? Did a contributed module prevent core from updating because of a strict constraint? If Composer reports a conflict, read the conflict output and resolve the underlying module compatibility issue—either by updating the contrib module or applying an upstream patch—rather than forcing constraints or deleting composer.lock.
If the project uses cweagans/composer-patches, watch the patch application output closely. A core patch that applied cleanly on 10.3.2 might fail on 10.3.5 if the upstream file changed, and a silently skipped patch can reintroduce a bug you fixed months ago.
Test real journeys, not just the admin login
Apply the updated codebase to your local environment or staging server and run database updates:
drush updatedb -y
drush cache:rebuild
If the update modified any configuration schemas or default settings, check drush config:status and export configuration if your workflow tracks it in Git.
Do not stop just because the homepage returns HTTP 200 and /admin loads. Walk through the paths that actually break during updates:
- Browse the homepage, search page, and a representative content page as an anonymous visitor (cached and uncached).
- Log in with an editor account, create a draft, upload an image or media entity, and save it.
- Submit a Webform or contact form and check recent watchdog logs (
drush watchdog:show --count=30). - If the site is multilingual, verify translated routes and field behaviour as outlined in Drupal Content Translation: Plan the Fields Before You Translate.
Deploy the tested lock file to production
Commit the updated composer.json, composer.lock, and any updated config/sync files to Git. When deploying to production, install strictly from the lock file without dev dependencies:
composer install --no-dev --optimize-autoloader
drush state:set system.maintenance_mode 1 --input-format=integer
drush updatedb -y
drush config:import -y # only if your project uses config management
drush cache:rebuild
drush state:set system.maintenance_mode 0 --input-format=integer
Confirm that the production PHP CLI and PHP-FPM versions match what you tested locally. On shared hosting or multi-PHP servers, it is surprisingly common for php -v in SSH to be PHP 8.2 while the web server runs PHP 8.1, which can trigger syntax errors only when a visitor hits the site.
Verify the deployed version and anonymous traffic
After taking the site out of maintenance mode, check /admin/reports/status (or drush status) and test the public site in a private browser window.
If Composer says you updated to the new version, yet Drupal’s status report still displays the old version, do not ignore it. That usually means your web server document root is pointing at an older release directory, OPcache is serving stale bytecode from a previous symlinked release, or web/core was not replaced properly during deployment. Fix the deployment symlink, reload PHP-FPM to clear OPcache, and verify again—never hand-edit core/lib/Drupal.php to mask the mismatch.