Updating drupal core and modules

To check which modules needed to be updated using drush

drush pm-update –pipe

the output should be like the list below:

Drupal core              7.20               7.26              SECURITY UPDATE available      
IMCE                    7.x-1.7            7.x-1.8           Update available                 Token                   7.x-1.4            7.x-1.5           Update available                 Views Slideshow         7.x-3.0            7.x-3.1           Update available                 Zen                     7.x-5.1            7.x-5.4           SECURITY UPDATE available

After you pick which modules you intend to update, there are several way to update a drupal  :

  • Updating via Drush (with svn)
  • Updating via Drush (without svn)
  • Updating manually (with svn)
  • Updating manually (without svn)
  • Updating on your live site

Notes:

  • The ‘drush up’ command updates modules, core, and runs update.php, to update all modules except the core use –no-core option  drush pm-update –no-core.
  • The ‘drush upc’ command updates modules only, and does not run update.php
  • to update only the core add drupal at  drush up -> drush up  drupal
  • to update a specific module  drush up project_name
  • drush updb  this will run update.php

Updating via Drush (without svn)

  1. Back up your database
  2. Run ‘drush up’ or ‘drush upc’
  3. Run ‘drush updb’ – this will run update.php

Updating via Drush (with svn)

  1. Change to the root of your Drupal install
  2. Back up your database
  3. Run ‘drush upc –version-control=svn –svnsync’. ‘drush upc’ updates all contributed modules, without running update.php OR updating core
  4. Update core: run ‘drush up dr’
  5. Run ‘drush updb’ to update your site locally.
  6. Test locally before committing to your development site.
  7. Add any new files and commit your changes. Use ‘svn add –force *’ to force the addition of all new files.
  8. Use ‘svn commit’ to commit your changes.
  9. Run ‘drush updb’
  10. Test

Updating manually (with svn)

  1. Back up your database
  2. Download the new version of the module from drupal.org
  3. ‘svn remove’ the old module file (‘svn rm sites/all/modules/modulefolder’)
  4. ‘svn commit’
  5. Extract the new module and place it in sites/all/modules
  6. ‘svn add’ the new module folder
  7. ‘svn commit’
  8. Run update.php. Do this by going to www.yoursite.com/update.php
  9. Test, test, test

Updating manually (without svn)

  1. Back up your database
  2. Download the new version of the module from drupal.org
  3. Delete the old module directory, and replace it with the new downloaded copy
  4. Run update.php. Do this by going to www.yoursite.com/update.php
  5. Test, test, test

Updating on your live site

  1. Back up your database.
  2. Put the site into maintenance mode. You can find that setting at /admin/settings/site-maintenance and select “Off-line.” Customize your offline message as appropriate.
  3. Update modules and core (following whatever steps you followed above: drush (with or without svn), svn, or manually).
  4. Run update.php. Do this by going to www.yoursite.com/update.php.
  5. Test.
  6. Take the site out of maintenance mode.
  7. Test more.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s