Your SlideShare is downloading. ×
0
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Staging Drupal: Change Management Strategies for Drupal
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Staging Drupal: Change Management Strategies for Drupal

6,543

Published on

This presentation was created for DrupalCamp NH 2011.

This presentation was created for DrupalCamp NH 2011.

Published in: Technology, Business
1 Comment
9 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,543
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
78
Comments
1
Likes
9
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
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

    • 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. <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. <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. The only thing that&apos;s constant is... DrupalCamp CT 2010
    • 5. <ul><li>Staging? What is that? </li></ul>DrupalCamp NH 2011 Staging Drupal – Change Management Strategies
    • 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. <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. <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. DrupalCamp NH 2011 Staging Drupal – Change Management Strategies
    • 10. <ul><li>Why it fails </li></ul><ul><li>It&apos;s tedious. </li></ul><ul><li>It&apos;s time-consuming. </li></ul><ul><li>It&apos;s error-prone. </li></ul><ul><li>It&apos;s risky. </li></ul>DrupalCamp NH 2011 Staging Drupal – Change Management Strategies
    • 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. Anatomy of a Drupal Site DrupalCamp NH 2011 Staging Drupal – Change Management Strategies Files Configuration Content Code
    • 13. <ul><li>A traditional approach </li></ul><ul><li>Use source control </li></ul>Staging Drupal – Change Management Strategies DrupalCamp NH 2011
    • 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. <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. <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. <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. <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. <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. <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. <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. <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. Enable modules <ul><li>function demo_update_7001() { </li></ul><ul><li>$ret = array(); </li></ul><ul><li>$modules = array( </li></ul><ul><li>&apos;ctools&apos;, </li></ul><ul><li>&apos;context&apos;, </li></ul><ul><li>&apos;devel&apos;, </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. Grant permissions <ul><li>function demo_update_7001() { </li></ul><ul><li>$ret = array(); </li></ul><ul><li>$role = user_role_load_by_name(&apos;admin&apos;); </li></ul><ul><li>$permissions = user_permission_get_modules(); </li></ul><ul><li>user_role_grant_permissions($role-&gt;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. Create content types <ul><li>function demo_update_7001() { </li></ul><ul><li>$types = array( </li></ul><ul><li>array( </li></ul><ul><li>&apos;type&apos; =&gt; &apos;article&apos;, </li></ul><ul><li>&apos;name&apos; =&gt; st(&apos;Article&apos;), </li></ul><ul><li>&apos;base&apos; =&gt; &apos;node_content&apos;, </li></ul><ul><li>&apos;description&apos; =&gt; st(&apos;Description.&apos;), </li></ul><ul><li>&apos;custom&apos; =&gt; 1, </li></ul><ul><li>&apos;modified&apos; =&gt; 1, </li></ul><ul><li>&apos;locked&apos; =&gt; 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. 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-&gt;name = st(&apos;Categories&apos;); </li></ul><ul><li>$vocabulary-&gt;machine_name = &apos;categories&apos;; </li></ul><ul><li>$vocabulary-&gt;description = st(&apos;Standard node categories&apos;); </li></ul><ul><li>$vocabulary-&gt;hierarchy = 1; </li></ul><ul><li>$vocabulary-&gt;module = &apos;demo&apos;; </li></ul><ul><li>$vocabulary-&gt;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. 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-&gt;name = st(&apos;Drupal&apos;); </li></ul><ul><li>$term-&gt;description = st(&apos;Category for all things Drupal&apos;); </li></ul><ul><li>$term-&gt;parent = array(0); </li></ul><ul><li>$term-&gt;vid = $vocabulary-&gt;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. <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. &nbsp;
    • 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>
    • 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
    • 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
    • 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
    • 34. &nbsp;
    • 35. What about content?? Staging Drupal – Change Management Strategies DrupalCamp NH 2011
    • 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>
    • 37. &nbsp;
    • 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>
    • 39. Questions?
    • 40. Thank You! http://twitter.com/ebeyrent http://drupal.org/user/23897

    ×