Jump to content

Fundraising/tech/crm/Upgrade Drupal

From Wikitech

Creating a Drupal upgrade patch

  • cd to your development clone of wikimedia/fundraising/crm.
    # Get and unpack the new release
    VERS=7.27 # for example
    wget http://ftp.drupal.org/files/projects/drupal-$VERS.tar.gz
    tar xzf drupal-$VERS.tar.gz
    
    # We're first operating on the upstream tracking branch.
    cd drupal
    git fetch --all; git checkout -t origin/contrib

    # It's best to wipe out any deprecated files, as we do here,
    # but you can omit the delete/exclude stanzas if you'd like.
    rsync -av \
        --delete --exclude '.git*' --exclude 'sites' \
        ../drupal-$VERS/ ./
    
    # Toss pinch of salt and add everything you find.
    git add -A
    git commit -m "Upgrade to Drupal $VERS upstream"
  • Push the drupal contrib commit for review. DO NOT SELF-MERGE, even if it seems like an emergency.
  • Merge to trunk
    git checkout -t origin/master
    git merge -m "Merge contrib" contrib
    
    # Do stupid thing to satisfy git-review
    git commit --amend
  • Push the drupal master commit for review.
  • In the top-level crm directory, update the submodule pointer.
    cd ..
    git checkout -t origin/master
    git add drupal
    git commit -m "Update drupal submodule to $VERS"
  • Push the submodule bump for review. The three review steps can be prepared in parallel, fwiw.
  • If there are any doubts, deploy to the staging box and test.

Deploying a Drupal upgrade

Please note that your particular upgrade may require additional precautions or other action, see the Drupal release notes for details.

  • Shut down all jenkins jobs which depend on the CRM. Just turn 'em all off if you're feeling lazy.
  • Kill the lights:
    # Make the site inaccessible
    drush vset site_offline 1; drush vset maintenance_mode 1
    
    # Clear caches
    drush cc all
    
    # Disable modules.  Please save this list to your notepad.
    MODULES=`drush pml --type=module --status=enabled --no-core --pipe`
    echo "Disabling modules $MODULES"
    drush dis $MODULES
  • Verify database backups are current.
  • Deploy new wikimedia/fundraising/crm code.
  • Make any necessary changes to settings.php and civicrm.settings.php — these are not under the same source control.
  • Start doing naughty things you cannot recover from without a database restore...
    # Update Drupal core schema
    drush updatedb
    
    # Enable modules
    drush en $MODULES
    
    # Update module schemas
    drush updatedb
    
    # Make site accessible
    drush vset site_offline 0; drush vset maintenance_mode 0
  • Turn jobs on again, slowly and carefully.

CiviCRM upgrade

Read the CiviCRM release notes.

TODO:

  • Port from old notes
  • Howto create patches and upstream things.

See also