drush updatedb for a single module

by nonsenz   Last Updated October 17, 2017 23:07 PM

Is it possible to perform a single module's update function via drush? I can see drush updatedb which does not take an modulename as argument and runs all available updates. Then there is drush pm-update wich also checks for new files. the documentation says:

(same as pm-updatecode + updatedb)

Does this mean if I run drush pm-update every available (newer update_function exits) update will be perfomed? Is there a way to only (db)update exactly one module?

Tags : 7 drush updating


Answers 6


No, you can't.

If you want to update each module on their own, only update the files of a single module and then run updatedb.

Berdir
Berdir
May 19, 2011 08:21 AM

If you want to run just one update, you can run drush eval foo_update_33(), for example. In practice, it is a little more complex than that as you have to load the .install file but not much.

You can also try @macaleaa solution :

drush php-eval 'module_load_install('my_module');my_module_update_7XXX();'

moshe weitzman
moshe weitzman
July 05, 2011 03:48 AM

neither drush up someproject, nor drush upc someproject seem seem to update only the someproject module. A different way to that what you want is through :

drush dl someproject #use --select option to be prompted for a module version
                     #this will overwrite your exising module's files
                     #backup your modules files with --backup, yourself, use a VCS to revert
drush updb           #run available database update scripts

Here is discussion a similar topic on Drupal.org. Take care !

myselfhimself
myselfhimself
June 19, 2012 09:44 AM

On Drush 5.7 you can run the command drush pm-update --no-core module-name. Drush will automatically backup the current module, download the new version and prompt you to update the database.

ahimsauzi
ahimsauzi
March 13, 2013 21:25 PM

I'm using Drush 5.9, & can update a single module successfully with this command:

drush dl *project*

So, for example, to update the 'devel' module:

drush up devel
Rod
Rod
September 18, 2013 10:13 AM

I believe this is now possible with Drush, using up:

drush up module_name
zgreen
zgreen
October 17, 2017 22:12 PM

Related Questions


drush pm-update status failed

Updated April 19, 2017 16:07 PM




Running drush up to several sites folders at once

Updated September 07, 2016 09:03 AM