docs:drupal:upgrading_using_git

upgrading drupal (git method)

These instructions are specific to when you have a live site, a development machine, and both are set up for git push/pull

Several places below reference running update.php. This means going to your yoursite.com/update.php after logging in as an administrator. If you are unable to log in, you can force access to update.php by editing the settings.php file in drupal/sites/yoursite/settings.php and set the following line to true (don't forget to change it back after updates are complete)

$update_free_access = FALSE;

change to:

$update_free_access = TRUE;
  • dev machine must connect to its own database, and not the live site database
  • working copy must be clean (no outstanding changes)
  • sync both your dev drupal database and all files with the live site, if you haven't already
  • if you haven't done so already, add a git remote for http://git.drupal.org/project/drupal.git and name the remote 'drupal' instead of origin. (origin will be for your company's shared repo)
  • log into the administration pages on your dev machine so your session is set up
  • get the most recent changes from drupal core
    git fetch drupal
  • on a clean master branch (master should be your version of the core, including any changes you had to make for this site, such as .htaccess file changes), determine which version of drupal you want to upgrade to, then merge the appropriate commit, typically by entering the tag which should match the version
    git merge 7.26
  • confirm that no conflicts exist, or correct any that are found and commit changes
  • go back to the drupal administration pages on your dev machine and run update.php
  • if no errors are detected, continue testing your site to make sure everything in your site AND with your modules are still working
  • if everything is ok, now check if any modules need upgraded below
  • you can either manually download and replace module files or use the Update module for some, if they support it
  • after updating desired modules, run update.php
  • if no errors are detected, continue testing your site to make sure everything in your site AND with your modules are still working
  • if everything is ok, make a git commit with all changes for Module updates (you can start a new branch if you prefer)
  • perform each of the above sections first
  • for all sites ran by this drupal instance, backup database and drupal directories, including sites directory
  • push all changes from dev machine to shared repo
  • log into live site and place it in maintenance mode
  • pull git changes from shared repo
  • run update.php
  • take site out of maintenance mode
  • flush all caches just for good measure
  • docs/drupal/upgrading_using_git.txt
  • Last modified: 2016/08/05 15:59
  • by billh