6

I have a site with a lot of modules running Drupal 7. I just installed a bunch of module updates, ran update.php, and then started running some tests, upon which I noticed that one of the module updates broke an important function on my site.

After some more testing, I discovered which module update broke the function (an update from rc1 to rc2). Reverting this module back to the previous version (rc1) restores the function on my site. However, when I installed rc2, there was an update to the database for that module which was performed when I ran update.php.

I'm going to wait for rc3/a 1.0 release of this module to update again. However, is it safe to simply re-install the old rc1 version over rc2? Or could this cause major problems down the line and should I instead revert from a backup?

I'm not giving specific module names because I'd like to know what the general best practice (if any) is for "downgrading" modules.

  • I assume you didn't take a database backup? – mpdonadio May 1 '12 at 10:42
  • I have a database backup, so in this case rolling back is not particularly a problem. However, what if I didn't, or what if I had already done some work before I realized the function was broken? (Assume I wasn't lucky.) – Patrick Kenny May 1 '12 at 10:45
6

I think the answer is that "it depends".

If the hook_update_N just added indexes, then you should be safe. If it added or changed columns, then you could have the instance were particular parts of the module work but others will fail (eg, parts that save to the database). Or, worse, you could start getting inconsistent data in the database for the custom tables. You should also see an error about the database on the status report.

I would look at the module in question, search for the hook_update_N definitions and see what changed. It may be documented in the changelog, but I don't always trust that everything was logged. Then make a judgement call about what to do.

5

I'm using a module called Backup and Migrate having set it to backup everyday so I will have a backup when I forget to backup before doing an module update.

I think the answer is yes if you made a backup, and No you can try to use the code with the updated database but if it's gonna work depends on the update. But also mosts database updates add fields or make fields bigger so that won't be a problem. Also the changes are included in the module update so you can easily see what the update did. And even reverse the update manually if you feel like poking around.

The real risk is there if fields or tables are deleted or renamed.

I haven't researched this though. It's just my experience installing modules, and writing own module updates / install files.

While having Backup and Migrate not installed it took me half a day to get everything back to normal ( I hope this helps anyone who is ( a bit ) new to drupal or hasn't found this module yet )

0

I realize this post is old but it is still active but I had to look for a way to rollback when I updated a bunch of modules when updating from Drupal 7.41 => 7.43. I received a php error: Fatal error: Class 'EntityCacheUserController' not found in /var/www/html//includes/common.inc on line 7999

I also backed up the files and DB but was looking for a less time intensive way to resolve.

I ran the drush command rebuild-registry (not a standard option). Running the command followed by drush cc all - brought the site back online.

I hope this helps.

/r

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.