Every time a new update is available, you should get it!
Here is an easy guide that will help you to update your Drupal 8 core.
Well, before getting started, here is a bit of clarification! Usually, on the “Drupal planet”, the term upgrade means levelling up to the latest major version of the CMS platform. For instance, Drupal version 7 to Drupal version 8 – this is an upgrade. On the other hand, the update means levelling up to the recent patch version of the Drupal 8 CMS platform. For instance, Drupal version 8.2.6 to Drupal version 8.2.7 – this is an update.
Drupal 8 brings you a plenty of intriguing features that can make your web development process significantly easier. Take a quick glance below and know what you are about to get by updating your Drupal 8 core.
Precautions to consider before updating Drupal 8 core
- Take a backup of all the files and entire database. It is advisable not to forget to activate the maintenance mode before applying any change to the Drupal 8 site. You can activate this mode from the admin panel.
- Before running the update on the live Drupal 8 website, it is better if you can update a test copy of the website first.
- Everytime Drupal releases a new patch, it releases a note as well. This note mentions all the changes and improvements that have been provided with the latest patch. Also, it includes the necessary guideline on how you can upgrade or update it to the latest versions or patches. So, having a quick glance at these notes is better.
Updating Drupal 8 core through Drush
Drush is the shell interface of Drupal that helps in performing the administrative tasks easily and quickly just by some command lines. Here’s a step-by-step guide.
#1 Install Drush.
#2 Run the command drush archive-drump to take the necessary backup of the files and database.
#3 Enter the command drush sset system.maintenance_mode 1 to activate the maintenance mode.
#4 Enter the drush pm-update command. It will start running the update procedure.
#5 Once the update is complete, you need to make the updated Drupal website online back. For this, simply run the drush sset system.maintenance_mode 0 command.
Yes! You are done!
Updating Drupal 8 core through Composer
Are you in a hurry? Well, this is the speediest method to update your Drupal 8 core.
The Composer is the powerful package management tool that is used while managing the PHP-based applications.
Through Composer, you can update the Drupal 8 core just in one step. Just enter the command composer update into the interface of the command line and the Drupal 8 core will be updated.
Manually updating Drupal 8 core
This is probably the most tedious updating method. Here is the step-by-step guide.
#1 You need to download the latest version of the Drupal 8.
#2 Login to the admin panel of the site. You need to login either as an admin or as a user, who has the permission to “administer software update”.
#3 Take a backup of the database. For instance, you can do it through the PHPMyAdmin.
#4 Next thing you need to do is to activate the maintenance mode. Here is how you can do it.
Administration -> Configuration -> Development -> Maintenance mode
#5 Now, you need to remove the core directory and the vendor from the website and need to replace these with the composer.lock, robots.txt, licence.txt, web.config, index.php, autoload.php. All these will be available at the time you download the newest Drupal 8 version.
An Important Note: You should remove the older directories and replace them with the new ones. You should not override the older directories! It will cause a WSOD error.
#6 From the site’s top-level directory, remove all the files. Well, keep the files that you have added manually and the ones you have made certain changes to (such as Google, error log file, Bing verification). You can keep your profiles, your themes, modules along with your site directories as well.
#7 Now, upload the latest Drupal 8 core directory.
#8 You need to extract and copy the composer.json, the composer.lock and the .htaccess files. You can find all these in the latest downloaded Drupal 8 version.
#9 Next, you need to upload the new vendor directory to the website.
#10 Go to yourwebsite’sdomainname.com/update
#11 Now, you just have to follow the instructions showing on the screen!
And you are done!
Use any of the aforementioned three methods, your Drupal 8 core will be updated. However, if you are facing any issue, you can always reach the best team of Drupal development in Sydney.
At GetAProgrammer, we have a skilled and dedicated team of the best Drupal developers, who will guide you. Consultation, development, implementation, customisation, maintenance and support – anything you need, we are there!
Found our blog helpful? Visit our official website and keep following us on LinkedIn for many such insightful blogs!