开发者

Upgrades to Drupal in production

开发者 https://www.devze.com 2022-12-10 16:15 出处:网络
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.

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 d开发者_高级运维ata 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


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消