Drupal upgrading tip

In my experience so far, the most annoying part of upgrading Core is disabling, then re-enabling, all the contrib modules. I’ve timed it more than once, and it’s accounted for more than half of the upgrade time. (Another huge chunk is waiting for files to upload/download/copy. Not much I can do about that. Update: what I can do about that is do all the backup and local unzipping (!) ahead of time.)

I know some people upgrade without disabling, but I’m WAY too paranoid. Apparently the Contrib Toggle module is dangerous/broken. And I have yet to figure out Drush.

On the other hand, I do know my way around an SQL statement and find & replace. So, here’s my new work-around:

SELECT name FROM system WHERE type = 'module' AND status = 1 AND filename LIKE 'sites/all/modules/%'

That gets the names of all the currently active contributed modules. Then I exported it to a CSV, and modified it so that each line read:

UPDATE system SET status='0' WHERE name='modulename';

Saved that as disable-modules.sql, then made a copy of the file, replacing 0 with 1, and named the new file enable-modules.sql.

Then all I had to do was run each file at the correct point in the upgrade sequence. I was pleasantly surprised to discover that it worked.

Things that made this MUCH nicer: not having to disable/enable modules in a specific order; not worrying about inducing the white screen of death; and being able to set up the files ahead of time. Since I have to come in at odd times to do updates, saving time is incredibly nice. 🙂