Search code examples
drupaldrupal-7drupal-modules

How do I update a drupal module without deleting it first?


How do I upload a new version of a module to my site? If I choose "Install new module" through the administration page I get a message that the module already is installed. There are two work arounds that I have found, but none of them seems ideal and the way you are supposed to do it.

  1. I can delete the old module first, and then upload and install the new version. However, if the modules has data associated with it, then this data will be lost.

  2. I can replace the module files on the server. This doesn't seem such a clean way to do it, I would rather follow a more standard process, if there is any.

So what is the best way to do it?

Thanks!


Solution

    1. Make a back-up...just in case.
    2. Put your site in maintance mode.
    3. Overwrite your module files with updated version (delete old module files first)
    4. run /update.php from browser or from console run drush updb if you have drush installed (to make database changes if any and similar stuff).
    5. Put your site in "normal" mode again...check if everything is ok.

    https://www.drupal.org/node/250790