Skip to content

Instantly share code, notes, and snippets.

@zuhairkareem
Last active April 2, 2018 10:08
Show Gist options
  • Select an option

  • Save zuhairkareem/c29ea87a11d7cbf3043faf6d07373e4e to your computer and use it in GitHub Desktop.

Select an option

Save zuhairkareem/c29ea87a11d7cbf3043faf6d07373e4e to your computer and use it in GitHub Desktop.
Drupal Core Upgrade

These are the ways you could upgrade core for 7 & 8

Drupal 7

  1. Take back up of files and db
  2. Put site in maintenance mode.
  3. Delete all files except the "sites" folder and any files such as ".htaccess" and "robots.txt" that have been customized.
  4. Download latest D7 version and upload the new files except the sites directory or the .htaccess or .robots.txt files.
  5. If changes have been made to robots.txt or .htaccess in the new version ensure these are incorporated into your version.
  6. Run Update.php by visiting yourdomain.com/update.php
  7. Switch off maintenance mode
  8. Test the site

Drupal 8

Manually

  1. Put the site into maintenance mode.
  2. Using the shell, navigate into your Drupal installation
  3. If you made manual modifications to files like .htaccess, composer.json, or robots.txt, back them up and reapply after update.
  4. Remove core and vendor folder from Drupal core. - rm -rf core vendor
  5. Remove all of the files in the top-level directory, except any that you added manually. - rm -f *.* .*
  6. Download Drupal core (8.5.1) tar ball from drupal.org (https://www.drupal.org/project/drupal/releases/8.5.1) and replace core and vendor folder of your drupal docroot and other scaffolding files(index.php, .htaccess etc.).
  7. After that run https://sitename/update.php in browser or "drush updb" in command line in the docroot.
  8. Deactivate maintenance mode.

Using Drush

  1. drush archive-dump - backup files and database.
  2. drush ups - check for updates.
  3. drush sset system.maintenance_mode 1
  4. drush cr - Clear Cache
  5. drush up drupal - Update drupal core
  6. If appropriate, re-apply any manual modifications to files. Such as .htaccess, composer.json, or robots.txt
  7. Reapply any core patches you were using before the upgrade (assuming that these haven't been merged yet).
  8. drush sset system.maintenance_mode 0 - Deactivate maintenance mode
  9. drush cr - Clear cache

Using Composer

  1. composer update drupal/core --with-dependencies
  2. drush updatedb - Update database
  3. drush cr - Clear cache

known issues - https://www.drupal.org/forum/support/upgrading-drupal/2018-03-29/upgrading-from-850-to-851-using-composer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment