0
<ul><li>Staging Drupal </li></ul><ul><li>Change Management Strategies for Drupal </li></ul>Staging Drupal – Change Managem...
<ul><li>http://twitter.com/ebeyrent </li></ul><ul><li>http://drupal.org/user/23897 </li></ul>DrupalCamp NH 2011 Introducti...
<ul><li>Agenda </li></ul><ul><li>Playing well with others </li></ul><ul><li>Managing code changes </li></ul><ul><li>Managi...
The only thing that's constant is... DrupalCamp CT 2010
<ul><li>Staging?  What is that? </li></ul>DrupalCamp NH 2011 Staging Drupal – Change Management Strategies
<ul><li>Staging?  What is that? </li></ul><ul><li>“ Staging” is the process of delivering changes from one environment to ...
<ul><li>I develop on the live server. </li></ul><ul><li>I work alone. </li></ul><ul><li>Backups? </li></ul>DrupalCamp NH 2...
<ul><li>The Manual Process </li></ul><ul><li>Point. </li></ul><ul><li>Click. </li></ul><ul><li>Wait. </li></ul><ul><li>Rin...
DrupalCamp NH 2011 Staging Drupal – Change Management Strategies
<ul><li>Why it fails </li></ul><ul><li>It's tedious. </li></ul><ul><li>It's time-consuming. </li></ul><ul><li>It's error-p...
<ul><li>The staging process should be: </li></ul><ul><li>Reliable </li></ul><ul><li>Repeatable </li></ul><ul><li>Scalable ...
Anatomy of a Drupal Site DrupalCamp NH 2011 Staging Drupal – Change Management Strategies Files Configuration Content Code
<ul><li>A traditional approach </li></ul><ul><li>Use source control </li></ul>Staging Drupal – Change Management Strategie...
<ul><li>Use source control </li></ul><ul><li>Essential to the development and staging process </li></ul><ul><li>Manages ch...
<ul><li>What goes into source control </li></ul><ul><li>Code, configuration, theme-based files </li></ul>Staging Drupal – ...
<ul><li>What goes into source control </li></ul><ul><li>Code, configuration, theme-based files </li></ul><ul><ul><li>Use s...
<ul><li>What goes into source control </li></ul><ul><li>Code, configuration, theme-based files </li></ul><ul><ul><li>Use s...
<ul><li>What goes into source control </li></ul><ul><li>Code, configuration, theme-based files </li></ul><ul><ul><li>Use s...
<ul><li>What goes into source control </li></ul><ul><li>Code, configuration, theme-based files </li></ul><ul><ul><li>Use s...
<ul><li>A traditional approach </li></ul><ul><li>Use source control </li></ul><ul><li>Manage changes in code </li></ul>Dru...
<ul><li>Manage database changes </li></ul><ul><li>Export your views, panels, rules, and content types to code </li></ul><u...
<ul><li>Why should we do this? </li></ul><ul><li>Multiple environments need to be updated </li></ul><ul><li>Allows for a p...
Enable modules <ul><li>function demo_update_7001() { </li></ul><ul><li>$ret = array(); </li></ul><ul><li>$modules = array(...
Grant permissions <ul><li>function demo_update_7001() { </li></ul><ul><li>$ret = array(); </li></ul><ul><li>$role = user_r...
Create content types <ul><li>function demo_update_7001() { </li></ul><ul><li>$types = array( </li></ul><ul><li>array( </li...
Create taxonomy <ul><li>function demo_update_7001() { </li></ul><ul><li>$ret = array();  </li></ul><ul><li>$vocabulary = n...
Create taxonomy terms <ul><li>function demo_update_7001() { </li></ul><ul><li>$ret = array();  </li></ul><ul><li>$term = n...
<ul><li>A traditional approach </li></ul><ul><li>Use source control </li></ul><ul><li>Manage database changes in code </li...
 
<ul><li>Use deployment tools </li></ul><ul><li>Source control as a deployment tool </li></ul><ul><ul><li>SVN update, post-...
Drupal Modules <ul><li>Deploy </li></ul><ul><li>Context </li></ul><ul><li>Features </li></ul><ul><li>Ctools </li></ul><ul>...
<ul><li>The process </li></ul><ul><li>Import current database snapshot into your sandbox </li></ul><ul><ul><li>Scrub your ...
<ul><li>Test the process </li></ul><ul><li>Install the Demo module </li></ul><ul><li>Take snapshot </li></ul><ul><li>Run u...
 
What about content?? Staging Drupal – Change Management Strategies DrupalCamp NH 2011
What about content?? Staging Drupal – Change Management Strategies DrupalCamp NH 2011 <ul><li>Staging content in Drupal su...
 
Drupal 8 <ul><li>Proper configuration management </li></ul><ul><li>A robust entity API and UUIDs in core </li></ul><ul><li...
Questions?
Thank You! http://twitter.com/ebeyrent http://drupal.org/user/23897
Upcoming SlideShare
Loading in...5
×

Staging Drupal: Change Management Strategies for Drupal

6,571

Published on

This presentation was created for DrupalCamp NH 2011.

Published in: Technology, Business
1 Comment
10 Likes
Statistics
Notes
  • Great presentation on staging Drupal at the NH Drupalcamp 2011.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total Views
6,571
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
78
Comments
1
Likes
10
Embeds 0
No embeds

No notes for slide
  • Databases are great for storing and querying data, not great for versioning and merging changes
  • Databases are great for storing and querying data, not great for versioning and merging changes
  • Databases are great for storing and querying data, not great for versioning and merging changes
  • Databases are great for storing and querying data, not great for versioning and merging changes
  • Databases are great for storing and querying data, not great for versioning and merging changes
  • Transcript of "Staging Drupal: Change Management Strategies for Drupal"

    1. 1. <ul><li>Staging Drupal </li></ul><ul><li>Change Management Strategies for Drupal </li></ul>Staging Drupal – Change Management Strategies DrupalCamp NH 2011
    2. 2. <ul><li>http://twitter.com/ebeyrent </li></ul><ul><li>http://drupal.org/user/23897 </li></ul>DrupalCamp NH 2011 Introductions <ul><li>Permissions API </li></ul><ul><li>Permissions Superuser </li></ul><ul><li>Crowd SSO </li></ul><ul><li>LDAP Extended Groups </li></ul><ul><li>Context Local Tasks </li></ul><ul><li>Search Lucene Biblio </li></ul><ul><li>Search Lucene Attachments </li></ul><ul><li>Search Lucene OG </li></ul><ul><li>Visual Search API </li></ul>My Modules Staging Drupal – Change Management Strategies Erich Beyrent
    3. 3. <ul><li>Agenda </li></ul><ul><li>Playing well with others </li></ul><ul><li>Managing code changes </li></ul><ul><li>Managing database changes </li></ul><ul><li>Managing content changes </li></ul><ul><li>Deployment strategies </li></ul>DrupalCamp NH 2011 Staging Drupal – Change Management Strategies
    4. 4. The only thing that's constant is... DrupalCamp CT 2010
    5. 5. <ul><li>Staging? What is that? </li></ul>DrupalCamp NH 2011 Staging Drupal – Change Management Strategies
    6. 6. <ul><li>Staging? What is that? </li></ul><ul><li>“ Staging” is the process of delivering changes from one environment to another. </li></ul>DrupalCamp NH 2011 Staging Drupal – Change Management Strategies
    7. 7. <ul><li>I develop on the live server. </li></ul><ul><li>I work alone. </li></ul><ul><li>Backups? </li></ul>DrupalCamp NH 2011 Staging Drupal – Change Management Strategies
    8. 8. <ul><li>The Manual Process </li></ul><ul><li>Point. </li></ul><ul><li>Click. </li></ul><ul><li>Wait. </li></ul><ul><li>Rinse and repeat. </li></ul>DrupalCamp NH 2011 Staging Drupal – Change Management Strategies
    9. 9. DrupalCamp NH 2011 Staging Drupal – Change Management Strategies
    10. 10. <ul><li>Why it fails </li></ul><ul><li>It's tedious. </li></ul><ul><li>It's time-consuming. </li></ul><ul><li>It's error-prone. </li></ul><ul><li>It's risky. </li></ul>DrupalCamp NH 2011 Staging Drupal – Change Management Strategies
    11. 11. <ul><li>The staging process should be: </li></ul><ul><li>Reliable </li></ul><ul><li>Repeatable </li></ul><ul><li>Scalable </li></ul><ul><li>Efficient </li></ul>DrupalCamp NH 2011 Staging Drupal – Change Management Strategies Staging Goals
    12. 12. Anatomy of a Drupal Site DrupalCamp NH 2011 Staging Drupal – Change Management Strategies Files Configuration Content Code
    13. 13. <ul><li>A traditional approach </li></ul><ul><li>Use source control </li></ul>Staging Drupal – Change Management Strategies DrupalCamp NH 2011
    14. 14. <ul><li>Use source control </li></ul><ul><li>Essential to the development and staging process </li></ul><ul><li>Manages changes to the code over time </li></ul><ul><li>With SVN, use a standard repository layout consisting of “tags, branches, trunk” </li></ul><ul><li>Use multiple repositories to separate core code from project code </li></ul>Staging Drupal – Change Management Strategies DrupalCamp NH 2011
    15. 15. <ul><li>What goes into source control </li></ul><ul><li>Code, configuration, theme-based files </li></ul>Staging Drupal – Change Management Strategies DrupalCamp NH 2011
    16. 16. <ul><li>What goes into source control </li></ul><ul><li>Code, configuration, theme-based files </li></ul><ul><ul><li>Use source control templates for files like settings.php </li></ul></ul>Staging Drupal – Change Management Strategies DrupalCamp NH 2011
    17. 17. <ul><li>What goes into source control </li></ul><ul><li>Code, configuration, theme-based files </li></ul><ul><ul><li>Use source control templates for files like settings.php </li></ul></ul><ul><li>What about database snapshots? </li></ul>Staging Drupal – Change Management Strategies DrupalCamp NH 2011
    18. 18. <ul><li>What goes into source control </li></ul><ul><li>Code, configuration, theme-based files </li></ul><ul><ul><li>Use source control templates for files like settings.php </li></ul></ul><ul><li>What about database snapshots? </li></ul><ul><ul><li>Databases are great at storing and retrieving data, not merging and versioning </li></ul></ul>Staging Drupal – Change Management Strategies DrupalCamp NH 2011
    19. 19. <ul><li>What goes into source control </li></ul><ul><li>Code, configuration, theme-based files </li></ul><ul><ul><li>Use source control templates for files like settings.php </li></ul></ul><ul><li>What about database snapshots? </li></ul><ul><ul><li>Databases are great at storing and retrieving data, not merging and versioning </li></ul></ul><ul><li>What about files? </li></ul>Staging Drupal – Change Management Strategies DrupalCamp NH 2011
    20. 20. <ul><li>A traditional approach </li></ul><ul><li>Use source control </li></ul><ul><li>Manage changes in code </li></ul>DrupalCamp NH 2011 Staging Drupal – Change Management Strategies
    21. 21. <ul><li>Manage database changes </li></ul><ul><li>Export your views, panels, rules, and content types to code </li></ul><ul><li>Use Exportables and Ctools to export other data </li></ul><ul><li>Manage configurations with Strongarm </li></ul><ul><li>Use Permissions API for roles and permissions </li></ul><ul><li>Use Features </li></ul>DrupalCamp NH 2011 Staging Drupal – Change Management Strategies
    22. 22. <ul><li>Why should we do this? </li></ul><ul><li>Multiple environments need to be updated </li></ul><ul><li>Allows for a phased approach to change management </li></ul><ul><li>Saves time and money </li></ul><ul><li>Is fully testable and reproducible </li></ul><ul><li>Minimizes downtime and helps manage expectations </li></ul>Staging Drupal – Change Management Strategies DrupalCamp NH 2011
    23. 23. Enable modules <ul><li>function demo_update_7001() { </li></ul><ul><li>$ret = array(); </li></ul><ul><li>$modules = array( </li></ul><ul><li>'ctools', </li></ul><ul><li>'context', </li></ul><ul><li>'devel', </li></ul><ul><li>); </li></ul><ul><li>module_enable($modules, TRUE); </li></ul><ul><li>return $ret; </li></ul><ul><li>} </li></ul>Staging Drupal – Change Management Strategies DrupalCamp NH 2011
    24. 24. Grant permissions <ul><li>function demo_update_7001() { </li></ul><ul><li>$ret = array(); </li></ul><ul><li>$role = user_role_load_by_name('admin'); </li></ul><ul><li>$permissions = user_permission_get_modules(); </li></ul><ul><li>user_role_grant_permissions($role->rid, array_keys($permissions)); </li></ul><ul><li>return $ret; </li></ul><ul><li>} </li></ul>Staging Drupal – Change Management Strategies DrupalCamp NH 2011
    25. 25. Create content types <ul><li>function demo_update_7001() { </li></ul><ul><li>$types = array( </li></ul><ul><li>array( </li></ul><ul><li>'type' => 'article', </li></ul><ul><li>'name' => st('Article'), </li></ul><ul><li>'base' => 'node_content', </li></ul><ul><li>'description' => st('Description.'), </li></ul><ul><li>'custom' => 1, </li></ul><ul><li>'modified' => 1, </li></ul><ul><li>'locked' => 0, </li></ul><ul><li>) </li></ul><ul><li>); </li></ul>Staging Drupal – Change Management Strategies DrupalCamp NH 2011 foreach ($types as $type) { $type = node_type_set_defaults($type); node_type_save($type); node_add_body_field($type); } node_types_rebuild(); }
    26. 26. Create taxonomy <ul><li>function demo_update_7001() { </li></ul><ul><li>$ret = array(); </li></ul><ul><li>$vocabulary = new stdClass(); </li></ul><ul><li>$vocabulary->name = st('Categories'); </li></ul><ul><li>$vocabulary->machine_name = 'categories'; </li></ul><ul><li>$vocabulary->description = st('Standard node categories'); </li></ul><ul><li>$vocabulary->hierarchy = 1; </li></ul><ul><li>$vocabulary->module = 'demo'; </li></ul><ul><li>$vocabulary->weight = 0; </li></ul><ul><li>taxonomy_vocabulary_save($vocabulary); </li></ul><ul><li>return $ret; </li></ul><ul><li>} </li></ul>Staging Drupal – Change Management Strategies DrupalCamp NH 2011
    27. 27. Create taxonomy terms <ul><li>function demo_update_7001() { </li></ul><ul><li>$ret = array(); </li></ul><ul><li>$term = new stdClass(); </li></ul><ul><li>$term->name = st('Drupal'); </li></ul><ul><li>$term->description = st('Category for all things Drupal'); </li></ul><ul><li>$term->parent = array(0); </li></ul><ul><li>$term->vid = $vocabulary->vid; </li></ul><ul><li>taxonomy_term_save($term); </li></ul><ul><li>return $ret; </li></ul><ul><li>} </li></ul>Staging Drupal – Change Management Strategies DrupalCamp NH 2011
    28. 28. <ul><li>A traditional approach </li></ul><ul><li>Use source control </li></ul><ul><li>Manage database changes in code </li></ul><ul><li>Use deployment tools </li></ul>DrupalCamp NH 2011 Staging Drupal – Change Management Strategies
    29. 30. <ul><li>Use deployment tools </li></ul><ul><li>Source control as a deployment tool </li></ul><ul><ul><li>SVN update, post-commit hooks </li></ul></ul><ul><ul><li>GIT push </li></ul></ul><ul><li>drush, rsync, make </li></ul><ul><li>Hudson, Phing </li></ul><ul><ul><li>http://drupal.org/project/phingdrushtask </li></ul></ul><ul><li>Capistrano </li></ul><ul><ul><li>https://github.com/gaspaio/Drupal-Capistrano-Deploy </li></ul></ul>
    30. 31. Drupal Modules <ul><li>Deploy </li></ul><ul><li>Context </li></ul><ul><li>Features </li></ul><ul><li>Ctools </li></ul><ul><li>UUID </li></ul><ul><li>Services </li></ul><ul><li>Boxes </li></ul><ul><li>Compare various staging modules: </li></ul><ul><li>http://drupal.org/node/980186 </li></ul>Staging Drupal – Change Management Strategies DrupalCamp NH 2011
    31. 32. <ul><li>The process </li></ul><ul><li>Import current database snapshot into your sandbox </li></ul><ul><ul><li>Scrub your database! </li></ul></ul><ul><li>Update your codebase </li></ul><ul><li>Develop, commit, update </li></ul><ul><li>Promote changes to QA environment, test </li></ul><ul><li>Tag or branch and release </li></ul><ul><li>Drink beer </li></ul>DrupalCamp NH 2011 Staging Drupal – Change Management Strategies
    32. 33. <ul><li>Test the process </li></ul><ul><li>Install the Demo module </li></ul><ul><li>Take snapshot </li></ul><ul><li>Run update.php </li></ul><ul><li>Verify results, watchdog, error_log </li></ul><ul><li>Rewind </li></ul>DrupalCamp NH 2011 Staging Drupal – Change Management Strategies
    33. 35. What about content?? Staging Drupal – Change Management Strategies DrupalCamp NH 2011
    34. 36. What about content?? Staging Drupal – Change Management Strategies DrupalCamp NH 2011 <ul><li>Staging content in Drupal sucks </li></ul><ul><ul><li>Several options, but none are 100% reliable </li></ul></ul><ul><ul><ul><li>All depend on the UUID module </li></ul></ul></ul><ul><ul><ul><li>Deploy, Node Export, Migrate, Services </li></ul></ul></ul><ul><ul><ul><li>Error-prone, authentication issues, transport errors </li></ul></ul></ul>
    35. 38. Drupal 8 <ul><li>Proper configuration management </li></ul><ul><li>A robust entity API and UUIDs in core </li></ul><ul><li>Join the discussion at http://groups.drupal.org/build-systems-change-management/cmi </li></ul>
    36. 39. Questions?
    37. 40. Thank You! http://twitter.com/ebeyrent http://drupal.org/user/23897
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×