How to update disabled modules using Drush?
-
16-10-2019 - |
Pergunta
Is there a way to update disabled modules with Drush
?
Currently, when I try to update a disabled module with Drush, I get this message:
Project has no enabled extensions and can't be updated
Enabling the module is not an option as this is a live site, actually many sites. They all run off of the same Drupal code base. Some modules are used by some sites but not others (possibly not on the main site).
If Drush can't handle this, what's an easy alternative for updating modules?
Solução
You can use drush
for it. First, you have to get the list of all modules that you've, for it you use drush pm-list
like this drush pm-list --no-core --pipe --type="module"
you'll get a list of all modules (enabled, disabled and uninstalled).
After, when you get all list of your modules, you can use drush dl [modules - list]
with this command drush
gonna download and replace the existent module. Like he does with drush up
.
The last problem is to run the update.php
, unfortunately this one you've to do it for each website or you can easily code a small script that do it.
Outras dicas
I use:
drush pm-updatecode --check-disabled
followed by:
drush @sites updatedb
The --check-disabled
option was added 2014-11-04
drush vset update_check_disabled 1 -y
So, I just realized that updating disabled modules is possible through Drush provided that you've set the check box for Check for updates of disabled modules and themes
in the settings of your Update manager manager module (at admin/reports/updates/settings
).
Then it's a matter of issuing the command drush up modulename
to update the module.