1.2.1. Updating Drupal 8 modules and core.
Drupal core and module updates are released frequently. While not all updates are necessary, security updates are critical and are highlighted in red by Drupal. Your update method depends on how Drupal was installed: via Composer or by downloading from Drupal.org.
Updating Drupal Using Composer
Composer makes it easy to update Drupal core with a single command:
composer update drupal/core --with-dependencies
The --with-dependencies
flag ensures that all dependent packages are updated. After updating, run the database update process using one of the following:
drush updatedb
drupal update:execute
/update.php
(in a browser)
Manually Updating Drupal Without Composer or Drush
For manual updates, refer to this article:
How to update Drupal 8 manually without Drush and Composer
Official guide:
Drupal.org - Updating Drupal Core
Preparation Steps
- Backup your entire site – files and database. Use tools like Adminer or phpMyAdmin for database backups.
- Download the latest version of Drupal 8 from drupal.org.
- Extract it and compare folders like
/vendor
for required libraries (e.g., for Drupal Commerce). - Enable maintenance mode:
/admin/config/development/maintenance
Update Process
- Delete all core Drupal files and folders except:
/sites
– content and config/themes
– custom themes/modules
– contributed/custom modules
Don’t forget to preserve your customized
.htaccess
,robots.txt
,settings.php
, andcomposer.json
(if used). - Upload the new Drupal files (except the ones above) into your site's root.
- If your host supports SSH, it's faster to upload the full archive and extract it via:
tar -xvzf drupal-x.y.z.tar.gz
orunzip drupal-x.y.z.zip
- If using FTP, use FileZilla and increase the number of parallel connections to speed up uploads.
- Restore your customizations:
settings.php
.htaccess
robots.txt
favicon.ico
- Run the update script in your browser:
/update.php
- Log in as admin and go to:
/admin/reports/status
to verify the update. - Disable maintenance mode:
/admin/config/development/maintenance
Pro Tip: Always test the update process locally before applying changes on the production site.
If you face any issues, post your errors or questions in the comments section of the guide — support is often available.