Staging Drupal Change Management Strategies for Drupal DrupalCamp - - PowerPoint PPT Presentation

staging drupal
SMART_READER_LITE
LIVE PREVIEW

Staging Drupal Change Management Strategies for Drupal DrupalCamp - - PowerPoint PPT Presentation

Staging Drupal Change Management Strategies DrupalCamp CT 2010 Staging Drupal Change Management Strategies for Drupal DrupalCamp CT 2010 Staging Drupal Change Management Strategies DrupalCamp CT 2010 Introductions Erich Beyrent


slide-1
SLIDE 1

Staging Drupal – Change Management Strategies DrupalCamp CT 2010

DrupalCamp CT 2010

Staging Drupal

Change Management Strategies for Drupal

slide-2
SLIDE 2

Erich Beyrent

http://twitter.com/ebeyrent http://drupal.org/user/23897

DrupalCamp CT 2010

Introductions

  • Permissions API
  • Crowd SSO
  • LDAP Extended Groups
  • Search Lucene Biblio
  • Search Lucene Attachments
  • Search Lucene OG
  • Visual Search API

My Modules

Staging Drupal – Change Management Strategies

slide-3
SLIDE 3

Agenda

  • Playing well with others
  • Managing code changes
  • Managing database changes
  • Deployment strategies

DrupalCamp CT 2010 DrupalCamp CT 2010 Staging Drupal – Change Management Strategies

slide-4
SLIDE 4

DrupalCamp CT 2010

The only thing that's constant is...

Staging Drupal – Change Management Strategies

slide-5
SLIDE 5

Staging? What is that?

DrupalCamp CT 2010 DrupalCamp CT 2010 Staging Drupal – Change Management Strategies

slide-6
SLIDE 6

Staging? What is that?

“Staging” is the process of delivering changes from one environment to another.

DrupalCamp CT 2010 DrupalCamp CT 2010 Staging Drupal – Change Management Strategies

slide-7
SLIDE 7
  • I develop on the live server.
  • I work alone.
  • Backups?

DrupalCamp CT 2010 DrupalCamp CT 2010 Staging Drupal – Change Management Strategies

slide-8
SLIDE 8

The Manual Process

  • Point.
  • Click.
  • Wait.
  • Rinse and repeat.

DrupalCamp CT 2010 DrupalCamp CT 2010 Staging Drupal – Change Management Strategies

slide-9
SLIDE 9

TOTAL FAIL

DrupalCamp CT 2010 DrupalCamp CT 2010 Staging Drupal – Change Management Strategies

slide-10
SLIDE 10

Why it fails

  • It's tedious.
  • It's time-consuming.
  • It's error-prone.
  • It's risky.

DrupalCamp CT 2010 DrupalCamp CT 2010 Staging Drupal – Change Management Strategies

slide-11
SLIDE 11

A traditional approach

  • Use source control

DrupalCamp CT 2010 DrupalCamp CT 2010 Staging Drupal – Change Management Strategies

slide-12
SLIDE 12

Use source control

  • Essential to the development and staging process

– Creates a flow from Dev → QA → Production

  • Manages changes to the code over time
  • Use a standard repository layout consisting of “tags,

branches, trunk”

  • Use multiple repositories to separate core code from

project code

DrupalCamp CT 2010 DrupalCamp CT 2010 Staging Drupal – Change Management Strategies

slide-13
SLIDE 13

What goes into source control

  • Code, configuration, theme-based files
  • Use source control templates
  • What about database snapshots?
  • DON'T manage user-generated content in source

control

DrupalCamp CT 2010 DrupalCamp CT 2010 Staging Drupal – Change Management Strategies

slide-14
SLIDE 14

A traditional approach

  • Use source control
  • Manage changes in code

DrupalCamp CT 2010 DrupalCamp CT 2010 Staging Drupal – Change Management Strategies

slide-15
SLIDE 15

Manage database changes

  • Export your views, panels, and content types to code
  • Use exportables and ctools to export other data
  • Manage configurations with Strongarm
  • Use Permissions API for roles and permissions
  • Use Features!

DrupalCamp CT 2010 DrupalCamp CT 2010 Staging Drupal – Change Management Strategies

slide-16
SLIDE 16

Why should we do this?

  • Multiple environments need to be updated
  • Allows for a phased approach to change management
  • Saves time and money
  • Is fully testable and reproducible
  • Minimizes downtime and helps manage expectations

DrupalCamp CT 2010 DrupalCamp CT 2010 Staging Drupal – Change Management Strategies

slide-17
SLIDE 17

Source Control and Update Scripts: Friends with Benefits

  • All changes can be viewed, compared, and reverted in

version control, which helps with debugging

  • Deployment processes are reproducible, and become

part of QA

  • Changes become portable and can be easily

replicated in multiple environments

DrupalCamp CT 2010 DrupalCamp CT 2010 Staging Drupal – Change Management Strategies

slide-18
SLIDE 18

Choose Wisely

  • How many changes are there?
  • How long will it take to write the update code?
  • How many environments need to be updated?

DrupalCamp CT 2010 DrupalCamp CT 2010 Staging Drupal – Change Management Strategies

slide-19
SLIDE 19

A traditional approach

  • Use source control
  • Manage database changes in code
  • Use deployment tools

DrupalCamp CT 2010 DrupalCamp CT 2010 Staging Drupal – Change Management Strategies

slide-20
SLIDE 20

Use deployment tools

  • Source control as a deployment tool

– SVN update, post-commit hooks – GIT push

  • Make, rsync
  • Aegir, Phing/Ant, Capistrano, Hudson

DrupalCamp CT 2010 DrupalCamp CT 2010 Staging Drupal – Change Management Strategies

slide-21
SLIDE 21

The process

  • Import current database snapshot into your sandbox
  • Update your codebase
  • Develop, commit, update
  • Promote changes to QA environment, test
  • Tag and release
  • Drink beer

DrupalCamp CT 2010 DrupalCamp CT 2010 Staging Drupal – Change Management Strategies

slide-22
SLIDE 22

The specifics

  • Changes are coded in a module
  • The module implements hook_update_N()
  • BUT WAIT, THERE'S MORE

– Installing a module does NOT invoke any

hook_update_N() implementations

– hook_install() and hook_update_N()

must be in sync

DrupalCamp CT 2010 DrupalCamp CT 2010 Staging Drupal – Change Management Strategies

slide-23
SLIDE 23

The specifics

  • Use the APIs (node, user, etc) instead of writing

queries

  • Use smaller update functions for maintainability

DrupalCamp CT 2010 DrupalCamp CT 2010 Staging Drupal – Change Management Strategies

slide-24
SLIDE 24

The specifics

  • Use the APIs (node, user, etc) instead of writing

queries

  • Use smaller update functions for maintainability

DrupalCamp CT 2010 DrupalCamp CT 2010 Staging Drupal – Change Management Strategies

slide-25
SLIDE 25

The Problems

  • Inconsistent and incomplete export functionality
  • Primary key issues with content
  • Dependencies
  • Requires technical proficiency

DrupalCamp CT 2010 DrupalCamp CT 2010 Staging Drupal – Change Management Strategies

slide-26
SLIDE 26

Drupal Tools

  • Devel: Generate: drupal.org/project/devel
  • Demonstration Site: drupal.org/project/demo
  • Node Export: drupal.org/project/node_export
  • Permissions API: drupal.org/project/permissions_api
  • Views Export: drupal.org/project/views
  • CCK: Content Copy: drupal.org/project/cck
  • Drush: drupal.org/project/drush

DrupalCamp CT 2010 DrupalCamp CT 2010 Staging Drupal – Change Management Strategies

slide-27
SLIDE 27

More Drupal Tools

  • Variable Dump: drupal.org/project/variable_dump
  • Exportables: drupal.org/project/exportables
  • Transformations: drupal.org/project/transformations
  • Migrate: drupal.org/project/migrate
  • Deploy: drupal.org/project/deploy
  • Features: drupal.org/project/features
  • Strongarm: drupal.org/project/strongarm

DrupalCamp CT 2010 DrupalCamp CT 2010 Staging Drupal – Change Management Strategies

slide-28
SLIDE 28

Questions?

DrupalCamp CT 2010 Staging Drupal – Change Management Strategies