Drupal - Is there a way to safely downgrade modules after installing a version that has a database update?

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.


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 )

Tags:

Updating

7