views:

128

answers:

2

Does anyone have a good Drupal upgrade strategy for an install that is in production? No one talks about this in books and it's hard to find a definitive answer in forums and email lists.

Ex:

  1. Lock down prod, don't allow updates to data copy prod
  2. copy prod database to dev
  3. turn off all modules in dev
  4. upgrade core Drupal in dev (update db if necessary)
  5. upgrade modules in dev (update db if necessary)
  6. turn on modules
  7. test
  8. migrate code and db to prod
  9. turn site back on
+4  A: 

Your strategy sounds good, but it would require a site to be in “read only” mode for quite a while. This is not always feasible. Also I am not quite sure why you would turn on and off all of the modules?

May I propose a slightly different approach

  1. copy prod database to dev
  2. replicate prod code in dev
  3. upgrade core Drupal in dev
  4. run update.php
  5. test
  6. For each module
  7. . Upgrade modules in dev
  8. . Run update.php
  9. . Test
  10. Put into maintenance mode
  11. Backup database
  12. Migrate code to production
  13. Run update.php
  14. Put back online test

This way there is a lot more testing but less downtime, also you will be able to work out which module breaks things if there is an error. It also dosn't rely on you uploading the DB from dev to live.

Jeremy French
+1 - Though I'd suggest swapping points 7 and 8 ;)
Henrik Opel
Done, also added "Backup database"
Jeremy French
I think we should also put 'run update.php' in the dev environment...step 2.5
milesmeow
Good idea, I have changed, and also made this post wiki.
Jeremy French
+3  A: 

Don't think there's any need to turn off modules before running update.php anymore (except maybe between major versions). And I definitely wouldn't run update.php once per module - that doesn't make sense with the way update hooks work.

If you're at all comfortable with the command-line (and running on a Linux server) then definitely have a look at Drush. It can simplify the process and allow parts of it to be scripted.

In addition, if you're looking for a formal update process to move stuff from your dev server to production for a large site, you should also be getting up to speed on the hooks that run during install and update.

Rob Russell
Agreed - I've upgraded a number of Drupal sites on a regular basis without turning the modules off nor running update.php for each individual one.
ceejayoz