How to mark a module so drush/drupal won't upgrade it

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by 404 on February 21, 2013 at 3:36am

How to mark a module so drush won't upgrade it? In other words, there's a module I want to keep it at a fixed version, I don't want drupal to check updated version for that module. So I can use drush up --no-core without worrying that module would be upgraded.

I tired to change the module.info, change the project name, the timestamp date, didn' t work.

Comments

There are two ways. drush

Posted by greg.1.anderson on February 21, 2013 at 4:17am

There are two ways.

  1. drush pm-updatecode --lock=module_to_ignore

  2. Use the update_advanced module (http://drupal.org/project/update_advanced); it will allow you to mark modules that you want to ignore on the module administration page.

Note that this question is also answered in the ever-handy Drush FAQ: http://drupal.org/drush-faq

It works, thank you!

Posted by 404 on February 21, 2013 at 5:47am

--lock param is a good solution.

Thank you very much! It could be better if I can write the module names in a file and have --lock to load it.

Sorry I didn't read through the faq. Most of the time I just use drush |grep keywords or dush.ws to learn how to use drush.

I see the drush.ws was updated to include this function. I should have read it before posting a question.

It's even better if there's a drush --long-help that lists all the parameters.

Something like this in a

Posted by brianmercer on February 21, 2013 at 5:19pm

Something like this in a drushrc.php file will probably work:

$command_specific['pm-update']['lock'] = array(
'module1',
'module2',
'module3'
);

This is neat! Than you!

Posted by 404 on March 4, 2013 at 1:10am

This is neat! Than you!

old cheesy solution

Posted by Michael-IDA on February 21, 2013 at 2:54pm

I've been using this since drush ~4.x, somewhat cheesy, but works:

# drush dis -y {base module name(s)}
{copy the list displayed by: "The following extensions will be disabled"}
# drush up
# drush en -y {all modules that were disabled}

With a known set of modules to not upgrade it's easy enough to script it (and dump the output to a log file for ease of viewing).

Of course expect extra QA time verifying the non-upgraded modules work correctly with the new core and other upgraded modules...

Best,
Sam

Note: syntax not verified.

.drush-lock-update file blocks updating

Posted by diamondsea on May 26, 2017 at 4:19pm

In modern drush you can put a .drush-lock-update file in the module's top directory. This will prevent "drush up" from updating that file. The contents of the file will be displayed in the "drush up" listing next to the module version.

You can also use "drush up --lock=ModuleName" to create the file for you.

.drush-lock-update

Posted by tolnor on July 13, 2017 at 10:15am

Hello diamondsea!

I have some sites with changed themes and i do not want to update it by drush.
The .drush-lock-update file will block the update of that themes too, or this work only for modules?

Thanks for your answer!

Works for themes too.

Posted by stefan lehmann on July 13, 2017 at 10:50am

Works for themes too.

Thank you Stefan :-)

Posted by tolnor on July 13, 2017 at 10:54am

Thank you Stefan :-)

drush

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /