There are many ways to update Drupal – manually, automatically, with Drush, or with Composer. Below we cover how to update Drupal manually:
Backup Your Drupal Files
- Backup Drupal with a module or backup cPanel
- Login to Drupal as an administrator
- Enable Maintenance Mode
Replace Drupal Core Files
There are two ways to download and remove Drupal core files:
- SSH requires comfort in the command line interface (CLI) and attention to detail, but it’s faster because you can copy commands from the article.
- cPanel and FTP are more user-friendly (and harder to make mistakes) but takes longer.
SSH
- Log into SSH
- Navigate to your Drupal root directory
- Delete the core and vendor directories:
rm -rf core vendor
- Remove all files (not other directories) in the directory:
rm -f *.* .[a-z]*
- Visit https://www.drupal.org/project/drupal and click the download link for the latest Drupal core version
- Download the core file:
wget https://ftp.drupal.org/files/projects/drupal-[version-number].tar.gz
Copy the download link to get the full file path
- Install the archive:
tar zxf drupal-[version-number].tar.gz
cd
into the new directory with the same name as the extracted archive:cd drupal-[version-number]
- Copy the core and vendor directories into your Drupal root directory:
cp -R core vendor ../
- Copy all of the files (not other directories) into your Drupal root directory:
cp *.* .[a-z]* ../
- (Optional) Make needed changes to your .htaccess, composer.json, and robots.txt
cPanel File Manager or FTP
- Log into Panel File Manager or FTP
- Navigate to your Drupal root directory
- Delete the core and vendor directories and all files (including hidden files) in the directory
- Visit https://www.drupal.org/project/drupal and click the download link for the latest Drupal core version
- Download the core file
- Upload the file to your server
- Extract the file
- Enter the new directory with the same name as the extracted archive
- Copy the core and vendor directories and all files (including hidden files but not other directories) into your Drupal root directory
- (Optional) Make needed changes to your .htaccess, composer.json, and robots.txt
Run The Drupal Update
- Visit [your-domain.com]/update.php
- Click Continue at the bottom
- Click Apply pending updates
- Click site or administration pages to log into Drupal
- Check the Status Report for any errors
- Disable maintenance mode when ready
- Remove the downloaded archive file and the folder of the same name
Stay up to date on available updates by configuring the Drupal Update Manager Settings.