How Can We Help?
< All Topics
Print

Upgrading Core Software in Drupal: A Step-by-Step Guide

a) How do I update the core software in Drupal ?

1. First, take a complete backup of your website.

2. Then, open settings.php (/sites/default/settings.php) in a plain text editor, find the line with the defaultfalse$settings [‘update_free_access’] variable, and change it to “true“:

$settings[‘update_free_access’] = TRUE;

3. Next, disable any caching technology that the application may be using (memcache, varnish, etc.).

4. After that, put your site into maintenance mode.

5. If you use Composer or Git for managing dependencies, skip the next six steps and follow the Creating a Development Site in Drupal: A Step-by-Step Guide Part B instructions for downloading the update file, then proceed with the update.php step.

6. Then, the latest version of Drupal 8.x core can be downloaded from Drupal.org in either tar.gz or zip file format.

7. After that, upload the archive file to your web hosting server.

8. Next, extract the archive file to a temporary directory on the server, outside the site hosting directory. Use your hosting control panel’s file manager or terminal access to your Linux hosting server:

tar -xzf drupal-8.3.2.tar.gz

9. Drush allows you to download and unzip an archive in one step by navigating to the temporary directory on the server and using the following command:

drush dl drupal

10. Then, remove core and vendor directories and non-subdirectory files like .htaccess, composer.json, and autoload.php from the site hosting directory, but avoid deleting customization files as they may lose custom functionality.

11. Next, copy the core and vendor directories, non-custom or non-custom files removed from the temporary directory, to the site directory.

12. After that, run the update.php script using any of the following commands:

  • Visit your website’s URL, http://www.example.com/update.php, and click “Continue” to execute the update script and complete the script successfully.
  • Run the drush updb command.

13. If you encounter any errors or warnings, kindly re-run the update.php script until all updates have been successfully completed.

14. Then, open settings.php (/sites/default/settings.php) in a text editor, locate the line containing the $settings[update_free_access] variable, and update it to “FALSE“:

$settings[‘update_free_access’] = FALSE;

15. After that, click on “Administration Page” to return to the admin section of the site.

16. Next, take your site out of maintenance mode.

17. Then, clear the cache.

18. Afterwards, re-enable any caching technologies that were disabled in step 3.

19. Finally, the updated version should be available for running, and the current version can be verified by checking the check-status report.

Table of Contents