New Podcast

Posted Friday, August 27 at 12:18 pm

Listen in as Ryan, Mike, and special guest Todd Tomlinson from ServerLogic discuss Drupal news from the past week. Todd is the author of Beginning Drupal 7 from Apress Publishing. Rather than going with a standard interview with Todd, we decided to ask him to join us for one of our news-based podcasts. Listen in as we talk about Drush, Examiner.com, Todd's current and future book, and a bunch of other Drupal-related stuff.

Download Podcast 43
DrupalEasy_ep43_20100815.mp3
Syndicate content

NEWSLETTER

Stay informed on our latest news!

Syndicate content

Testimonial

The DrupalEasy workshop provided a balance between "Best Practices" for Drupal development and an elegant example of integrating content from Youtube , Flickr, etc. using the FeedAPI. The workshop provided useful insights in advanced site design and a wealth of resources to speed up development and make deployment safer.

Who are we?

DrupalEasy is the collective expertise of Ryan Price and Michael Anello, who joined forces to provide training and consulting services worldwide. Read all about them and what they can do.

What is Drupal?

Drupal is a free, super-powerful content management system for sites that require information posting and collection, including blogs, forums, videos, photos, and databases of information. We think it is the best platform available. Here's why...

Why Drupal?

More and more savvy organizations are going with Drupal for content management, and its no mystery why. It’s free, flexible, and easy to maintain for small or large volume sites. Learn more...

Current Posts

DrupalEasy Podcast 43: Hybrid

Listen in as Ryan, Mike, and special guest Todd Tomlinson from ServerLogic discuss Drupal news from the past week. Todd is the author of Beginning Drupal 7 from Apress Publishing. Rather than going with a standard interview with Todd, we decided to ask him to join us for one of our news-based podcasts. Listen in as we talk about Drush, Examiner.com, Todd's current and future book, and a bunch of other Drupal-related stuff.

5 Stories

Thanks to Webenabled for sponsoring this week's podcast. Create, develop, and deploy Drupal applications entirely on the Webenabled platform. Top-notch support included with every account.

Picks of the Week - every podcast we each pick a module, theme, or other Drupal-related "thing" that we'd like to spread the word about.

Site of the Week - every podcast we collectively pick a (usually new) Drupal site to be highlighted and discussed. This week's pick is PriceDropWatch.co.uk, sent in by John Carney. 

If you'd like your site highlighted, please submit it at http://DrupalEasy.com/siteoftheweek. 

Bookaway - We also picked the winners of Beginning Drupal from Wrox Publishing by Jacob Redding. They are:

  • http://drupaleasy.com/sites/all/themes/blueprint/images/icons/menu-leaf.gif);">Igor Santos from Spain
  • http://drupaleasy.com/sites/all/themes/blueprint/images/icons/menu-leaf.gif);">Mario Hernandez from California
  • http://drupaleasy.com/sites/all/themes/blueprint/images/icons/menu-leaf.gif);">Darrel Branson from Australia

To win a copy of Beginning Drupal 7 from Apress Publishing - written by our special guest Todd Tomlinson, simply leave a comment below. Be sure to leave some identifying information so we know how to contact you (your Drupal.org username or Twitter handle work best). DrupalEasy Podcast listeners can also get 25% off any Apress eBook by using the coupon code "DRUPALEASYKWL" during checkout. 

Also - be sure to check out Andrew Riley's Module-a-Day Podcast

Follow us on twitter:

If you'd like to leave us a voicemail, call 321-441-3964. Please keep in mind that we might play your voicemail during one of our future podcasts. Feel free to call in with suggestions, rants, questions, or medicinal advice for Andrew. If you'd rather just send us an email, please use our contact page at http://DrupalEasy.com/contact

DrupalEasy at Drupal Camp Connecticut

No votes yet

Drupal Camp CT logoDrupalEasy is one of the sponsors of this Saturday's (August 28, 2010) first-ever Drupal Camp Connecticut, to be held at Yale University in New Haven. The camp sold out with about 175 attendees a few days ago, so if you don't have a ticket, you might be out-of-luck (you can always try begging).

Mike Anello from DrupalEasy (born and raised in Connecticut!) will be presenting three sessions:

Jeff Robbins from Lullabot will be giving the keynote, titled Beyond Web 2.0. Always an entertaining speaker, Jeff's keynote is not to be missed.

With current DrupalCamps getting larger and more organized, attending one is a great opportunity to meet other Drupalists in your geographic area. It's also a great opportunity to increase and share your knowledge about Drupal. Perhaps the best thing about DrupalCamps is the the opportunities for business networking and making your local Drupal community stronger.

Trackback URL for this post:

http://www.drupaleasy.com/trackback/391
AttachmentSize
basic_site_maintenance.pdf470.11 KB
fusion_and_skinr.pdf1.11 MB
image_handling.pdf5.95 MB

Fast and Safe Module Updates with Drush and SVN

Average: 4 (2 votes)

SecurityOne of the primary ways of keeping a Drupal site of any size running securely and at peak performance is to ensure that all of its modules stay updated. With thousands of modules in the Drupal eco-system, updates are released literally every day. Luckily, Drupal core's Update Status module helps site administrators keep notified of modules in need of updating.

In this article, you'll learn how to use the power of Drush and Apache Subversion (aka "svn"), a revision control tool, to update your site's module quickly and safely. You'll be presented with two methods for solving the problem. The second method is much faster, but comes with a caveat. Read on.
What does it mean to perform a module update "safely"? For the context of this article, "safely" means the ability to rollback a module update quickly if it breaks something on your site. This often requires a two-step approach: both reverting to the previous version of the module and reverting to a previous version of the site's database, as module updates often involve database updates. The use of a source code respository (svn, for the sake of this article) and timely database backups fulfills this saftey requirement.
 
Of course, it goes without saying that module updates should always be tested on a development site before being deployed on a live site. 
 
The Fast, Unsafe Way (no drush or svn)
 
Back when dinosaurs roamed the earth, many Drupal web sites were maintained in a very cavelier manner with no source code repository utilized. This made module updates very fast, but also very dangerous. To update a module, all you had to do was FTP the new version up to your server (overwriting the old one), run update.php, cross your fingers, and hope that nothing went wrong. Thankfully, most site maintainers have learned (the hard way) that this can lead to disaster. While this practice is still possible, certainly no one in the Drupal community upgrades modules this way anymore
 
A Safe, but Tedious Method (drush and svn, separately)
 
Subversion logoAs source code repositories became more accessible (friendly), more and more developers realized their benefits and started using them. While Drupal.org currently uses CVS, one of the most widely used source code repository systems in the Drupal community (for now) is svn. This article isn't going to talk about how to implement svn, as there are many resources available.
 
Drush logo

Assuming you haven't been living under a rock for the past year or so, you're probably aware that the Drupal community has embraced Drush, a command-line interface for interacting with your Drupal web site. Drush allows you to quickly perform tasks that you'd normally have to wade through Drupal's user inteface to accomplish (clearing caches, downloading modules, etc...) The real power of Drush comes into play when you start creating command line scripts that combine multiple Drush commands.

 
Using svn and Drush together to perform module updates is common practice. Unfortunately, it can be a bit tedious. Here's a high-level view of the process:
 
  • backup your database (I still like to use the Backup and Migrate module for this, although it is possible using Drush)
  • remove the module to be upgraded using svn
  • commit the change to svn
  • use drush to download the new version of the module
  • add the module to svn
  • commit the change to svn
  • run update.php
From the command line (after backing up the database), the process looks like this (for the Devel module):
$ svn del devel
D     devel/ui.mouse.js
D     devel/devel_node_access.info
... lots of files in here ...
D     devel/README.txt
D     devel
$ svn commit -m 'removing old devel module'
Deleting       modules/devel
Committed revision 147.
$ drush dl devel
Project devel (6.x-1.21) downloaded to /sites/demo/sites/all/modules/devel.   [success]
$ svn add devel
A         devel
A         devel/devel-rtl.css
A         devel/devel.css
A         devel/devel.info
... lots of files in here ...
A         devel/ui.draggable.js
A         devel/ui.mouse.js
$ svn commit -m 'adding updated devel module'
Adding         modules/devel
Adding         modules/devel/LICENSE.txt
Adding         modules/devel/README.txt
... lots of files in here ...
Adding         modules/devel/ui.draggable.js
Adding         modules/devel/ui.mouse.js
Transmitting file data .....................................
Committed revision 148.
$ drush updatedb
The following updates are pending:

 devel module                                                        

 6003 - As per issue #813132: change schablon.com to white for krumo.

Do you wish to run all pending updates? (y/n): y
Executing devel_update_6003                              [success]
'all' cache was cleared                                  [success]
Finished performing updates.                             [ok]
$ 
It is even possible to use Drush to perform the database backup via "drush sql-dump", something which I have not yet configured for my particular system. The "drush updatedb" command not only performs the database update (update.php), but it even clears that cache for you.
 
Another method for removing the old module files is to remove the existing module files (but not directories) via the rm command, then using Drush to download the new module, then commit all the changes at once using svn. This method is a bit more tedious than the method outlined above, but gives you the advantage of improved change tracking in svn.
 
While this method is perfectly sound, there are quite a few steps involved.
 
The Safe, Fast Method (drush and svn combined!)
 
Luckily, the current maintainers of the Drush module (Moshe Weitzman, Owen Barton, Adrian Rossouw, and greg.1.anderson have included SVN support to Drush (next time you see them on IRC, throw them some karma)! This means that we can reduce the number of steps significantly:
 
  • backup your database
  • use drush to download the new version of the module, commit the changes to svn, and perform the database update all in a single step!
From the command line (after backing up the database), the process looks like this (for the Transliteration module):
$ drush pm-update --svnsync --svncommit transliteration
Refreshing update status information ...
Done.
Update information last refreshed: Wed, 08/11/2010 - 12:44

Update status information on all installed and enabled Drupal projects:
 Name                         Installed version          Proposed version           Status                          
 AddThis Button               6.x-2.9                    6.x-2.9                    Up to date                      
 Advanced help                6.x-1.2                    6.x-1.2                    Up to date                      
 Automatic Nodetitles         6.x-1.2                    6.x-1.2                    Up to date                      
 Backup and Migrate           6.x-2.2                    6.x-2.2                    Up to date                      
 Better Formats               6.x-1.2                    6.x-1.2                    Up to date                      
 Acquia Drupal                1.2.25 (Drupal 6.17 core)  1.2.26 (Drupal 6.17 core)  SECURITY UPDATE available       
 CCK Private Fields           6.x-1.1                    6.x-1.1                    Up to date                      
 CCK Redirection              6.x-1.2                    6.x-1.2                    Up to date                      
 Content Profile              6.x-1.0                    6.x-1.0                    Up to date                      
 Chaos tool suite             6.x-1.6                    6.x-1.7                    Update available                
 Deployment                   6.x-1.x-dev                6.x-1.x-dev                Update available                
 Devel                        6.x-1.21                   6.x-1.21                   Up to date                      
 Domain Access                6.x-2.5                    6.x-2.5                    Up to date                      
 Embedded Media Field         6.x-1.20                   6.x-1.24                   Update available                
 Environment Indicator        6.x-1.0                    6.x-1.0                    Up to date                      
 Flag                         6.x-1.3                    6.x-1.3                    Up to date                      
 Flag Friend                  6.x-1.0-rc4                6.x-1.0                    Update available                
 getID3()                     6.x-1.3                    6.x-1.4                    Update available                
 Global Redirect              6.x-1.2                    6.x-1.2                    Up to date                      
 Hierarchical Select          6.x-3.1                    6.x-3.3                    SECURITY UPDATE available       
 Image Resize Filter          6.x-1.9                    6.x-1.9                    Up to date                      
 IMCE                         6.x-2.0-beta3              6.x-2.0-rc1                Update available                
 IMCE Wysiwyg bridge          6.x-1.1                    6.x-1.1                    Up to date                      
 Invite                       6.x-2.0-alpha1             6.x-2.0-beta2              Update available                
 Migrate                      6.x-1.0                    6.x-1.0                    Up to date                      
 Migrate Extras               6.x-1.0-beta1              6.x-1.0-beta1              Up to date                      
 Nodequeue                    6.x-2.9                    6.x-2.9                    Up to date                      
 Organic groups               6.x-2.1                    6.x-2.1                    Up to date                      
 Panels                       6.x-3.5                    6.x-3.7                    Update available                
 Path redirect                6.x-1.0-beta6              6.x-1.0-beta7              Update available                
 Quick Tabs                   6.x-2.0-rc4                6.x-2.0-rc4                Up to date                      
 Radioactivity                6.x-1.3-rc1                6.x-1.3                    Update available                
 Scheduler                    6.x-1.7                    6.x-1.7                    Up to date                      
 Schema                       6.x-1.7                    6.x-1.7                    Up to date                      
 Skinr                        6.x-1.5                    6.x-1.5                    Up to date                      
 Taxonomy Image               6.x-1.6                    6.x-1.6                    Up to date                      
 Transliteration              6.x-2.1                    6.x-3.0                    Installed version not supported 
 Table Wizard                 6.x-1.2                    6.x-1.3                    Update available                
 Views Bulk Operations (VBO)  6.x-1.9                    6.x-1.9                    Up to date                      
 Views cycle                  6.x-1.0-beta4              6.x-1.0                    Update available                
 Wysiwyg                      6.x-2.1                    6.x-2.1                    Up to date                      
 Copywrite                    6.x-1.0                    6.x-1.1                    Update available                
 Fusion                       6.x-1.0-rc1                6.x-1.0                    Update available                

Code updates will be made to the following projects:
Transliteration [transliteration-6.x-3.0]

Note: Updated projects can potentially break your site. It is NOT recommended to update production sites without prior testing.
Note: A backup of your package will be stored to backups directory if it is not managed by a supported version control system.
Note: If you have made any modifications to any file that belongs to one of these projects, you will have to migrate those modifications after updating.
Do you really want to continue? (y/n): y
Project transliteration was updated successfully. Installed version is now 6.x-3.0.
Project committed to Subversion successfully                                                                                      [ok]
'all' cache was cleared                                                                                                           [success]
No database updates required                                                                                                      [success]
'all' cache was cleared                                                                                                           [success]
Finished performing updates.                                                                                                      [ok]
$ 
The first thing that the drush pm-update command does is ensure that the update information is up-to-date - it performs the same function as the "Check manually" link on the admin/reports/updates page of your Drupal site.
 
 

One the update information is refreshed, the updates can begin. Let's look at the command in detail:

  • pm-update is the function that will actually download, install, and perform the database updates for any modules that are out-of-date ("pm" stands for "package manager")
  • --svnsync tells drush to add/delete any new or obsolete files in the module from the SVN repository
  • --svncommit tells drush to commit the changes to the site's SVN repository
  • transliteration is the name of the module to be updated. If you run the command without a module name, it will attempt to update all modules that are out-of-date.

A-ha! Gotcha!

There is one "gotcha" using this method that you should be aware of. This method doesn't remove the out-of-date module before downloading the new one. This means that files in the out-of-date module that should not be present in the new version are still present. Confused? Here's an example: Ubercart was recently upgraded from version 2.2 to 2.3. The "uc_order" module of Ubercart recently changed they way it handles email template files to the standard Drupal template method. This change removed two files from the ubercart/uc_order/templates/ directory:
 
  • admin.itpl.php
  • customer.itpl.php
and added three files:
 
  • uc_order-admin.tpl.php
  • uc_order-customer.tpl.php
  • uc_order.tpl.php
When performing the module upgrade using drush pm-upgrade --svnsync --svncommit ubercart, the three new files were added, but the two obsolete files were not removed. Luckily, this was a harmless oversight, but may not be for some module updates (Views has been a culprit on several occasions).  A Drush feature request has been added but no work has been completed for this as of yet.
 
Consider yourself warned.
 

Conclusion

Module updates are an important part of maintaining any Drupal site. Performing them in a safe and secure manner can help you avoid headaches in the future. Drush and SVN are great tools to help you perform updates when used separately. Combine them, and you'll have something that is more than the sum of its parts, and save yourself a boat-load of time.
 
Thanks to Ryan Price and Damien McKenna for reviewing this post.

Trackback URL for this post:

http://www.drupaleasy.com/trackback/388

DrupalEasy Podcast 42 - Drupal Performance with kbahey

Khalid Baheyeldin is a co-founder of 2bits.com out of Waterloo, Ontario, Canada. They have been using Drupal since 2003, and now specialize in helping Drupal sites scale - normally with very little buzzword compliance. Listen as Mike Anello and Ryan Price get Khalid to answer their questions and talk about some of his past contributions.

Follow us on twitter:

If you'd like to leave us a voicemail, call 321-441-3964. Please keep in mind that we might play your voicemail during one of our future podcasts. Feel free to call in with suggestions, rants, questions, or medicinal advice for Andrew. If you'd rather just send us an email, please use our contact page at http://DrupalEasy.com/contact

DrupalEasy Podcast 41 - Interview with Jacob Redding

Ryan Price and Mike Anello recently talked with Jacob Redding (jredding), author of Beginning Drupal as well Treasurer and Interim General Manager of the Drupal Association.

Beginning Drupal, released earlier this year by Wiley Publishing, covers a large selection of Drupal topics. Jacob mentions that he wrote the book to be a reference for someone who is not only building a Drupal site, but who also wants to really understand how Drupal works.

The book was written for Drupal 7 - many of the topics in the book cover the changes between Drupal 6 and Drupal 7 including (but definitely not limited to): user vs. profile fields, public and private fields, content type block visibility, and localization.

Jacob, Ryan, and Mike discuss specific portions of the book and the style in which it is written. Jacob has been a professional Drupal trainer for several years, and has tried to leverage what he has learned about teaching Drupal when writing this book. As an added bonus, the subject of zoot suits was brought up as well.

Wiley Publishing has given us a couple of copies of the book to giveaway - simply leave a comment below (be sure to leave your twitter or drupal.org username so we have some way to contact you) and we'll pick two winners at random.

Want more information about Jacob? Check him out at @jredding on Twitter or on his blog at jredding.info.

UPDATE - comments and content registration is closed. Winners will be announced on DrupalEasy Podcast 42.

The Outbreak Monkey

Listen in a Andrew, Ryan, and Mike discuss Drupal news from the past week. In this week's episode, we discuss core themes, open source software licenses, HTML5, and metaphors (among other things).

5 Stories

Thanks to Webenabled for sponsoring this week's podcast. Create, develop, and deploy Drupal applications entirely on the Webenabled platform.

Picks of the Week - every podcast we each pick a module, theme, or other Drupal-related "thing" that we'd like to spread the word about.

Site of the Week - every podcast we collectively pick a (usually new) Drupal site to be highlighted and discussed. This week's pick is PGA.com - http://pga.com/

If you'd like your site highlighted, please submit it here: http://DrupalEasy.com/siteoftheweek

Follow us on twitter:

If you'd like to leave us a voicemail, call 321-441-3964. Please keep in mind that we might play your voicemail during one of our future podcasts. Feel free to call in with suggestions, rants, questions, or medicinal advice for Andrew. If you'd rather just send us an email, please use our contact page at http://DrupalEasy.com/contact

DrupalEasy Podcast 39: Both Sides of Midnight

Listen in a Andrew, Ryan, and Mike discuss Drupal news from the past week. In this week's episode, Ryan talks about his trip to Design4Drupal, we all wonder why anyone would be against a code of conduct, and we plan out exactly how to get Drupal 7 released.

5+ Stories

Thanks to Webenabled for sponsoring this week's podcast. Create, develop, and deploy Drupal applications entirely on the Webenabled platform.

Picks of the Week - every podcast we each pick a module, theme, or other Drupal-related "thing" that we'd like to spread the word about.

Site of the Week - every podcast we collectively pick a (usually new) Drupal site to be highlighted and discussed. This week's pick is Dahon Folding Bicycles - http://dahon.com/ - recently featured in a Drupal.org case study http://drupal.org/Dahon-Folding-Bicycles

If you'd like your site highlighted, please submit it here: http://DrupalEasy.com/siteoftheweek

Follow us on twitter:

If you'd like to leave us a voicemail, call 321-441-3964. Please keep in mind that we might play your voicemail during one of our future podcasts. Feel free to call in with suggestions, rants, questions, or medicinal advice for Andrew. If you'd rather just send us an email, please use our contact page at http://DrupalEasy.com/contact

DrupalEasy Podcast 38 - Wizards, Snowmen and Drupal. Oh my!

Join us as we do our first multi-continental podcast where we end up losing Ryan in bat country. Somewhere along the way we talk about Drupal.

5 Stories

Picks of the week

Site of the week
Leffe Belgian Brewery

Follow us socially:
@drupaleasy
@liberatr
@ultimike
@andrewmriley
http://friendfeed.com/drupaleasy

If you'd like to leave us a voicemail, call 321-441-3964. Please keep in mind that we might play your voicemail during one of our future podcasts. Feel free to call in with suggestions, rants, questions, or cold weather advice for Ryan. If you'd rather just send us an email, please use our contact page at http://DrupalEasy.com/contact

DrupalCamp Organizer Survey

Average: 5 (1 vote)

The Drupal Association is trying to figure out the best way it can help DrupalCamp organizers. To that end, we've create a quick survey for DrupalCamp organizers to help the association determine how DrupalCamps are currently organized and managed.

The survey is divided into three sections: general information, finances/legal, and miscelleanous. The "general information" section has four questions about the date, location, and size of the camp. The "finances and legal" section has four questions about the size of the budget, registration fees, and legal organization of the camp. The survey concludes with a four-question "miscelleanous" section that asks about camp purchases (including event insurance), volunteers, and a text area for additional comments.

Only one organizer from each camp needs to complete the survey (we'll take care of any duplicates). So far we've collected about 30 responses, and we'd like to ensure that representatives from all DrupalCamps have a chance to respond.

The association will use the survey responses to determine how they can best support local DrupalCamps. If you're a DrupalCamp organizer, please complete the survey!

Trackback URL for this post:

http://www.drupaleasy.com/trackback/379

DrupalEasy Podcast 37: Interview with Ed Sussman about Buzzr.com

Buzzr.com was created in partnership with Lullabot and Bond Art + Science by Ed Sussman. In this interview, Ed talks about his career in journalism and starting companies - Ed was in charge of the web sites for Inc.com, FastCompany.com, FastCompany.tv and many other sites created by Mansueto in the first decade of this century.

Buzzr - Powerful Websites Made Easy - is a hosted service based on Drupal. A rich usability layer on top of Drupal 6 simplifies theming, content administration, access control, information architecture and form building by re-imangining the interface to some of Drupal's most widely-used and powerful modules.

Thanks to @DamienMcKenna, Oliver Dow and @xentek for submitting questions for Ed. Next time we schedule an interview, we will be posting a call for questions to twitter for our listeners.

Follow us socially:
@drupaleasy
@liberatr
@ultimike
@andrewmriley
http://friendfeed.com/drupaleasy

If you'd like to leave us a voicemail, call 321-441-3964. Please keep in mind that we might play your voicemail during one of our future podcasts. Feel free to call in with suggestions, rants, questions, or cold weather advice for Ryan. If you'd rather just send us an email, please use our contact page at http://DrupalEasy.com/contact