In Drupal 7 there was a system table which had various fields for the modules found by the system. There was a status column where one could edit and set to 0 to disable a module manually.

I am just beginning to test Drupal 8 and have had a module I just installed have and error. I can't go back to the module page to disable the module.

How can I disable a module manually in Drupal 8??

Comments

swentel’s picture

Status: Active » Fixed

That's now in a configuration file - see sites/default/files/config_xxxxxxx/active/system.module.yml - you'll have to clear the cache_bootstrap file after that as well.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

mahtab_alam’s picture

you can disable the module from drush commands
drush pm-uninstall module_name

soumyapsadanandan’s picture

This is how, I manually removed a module named "better_messages" from my Drupal 8 instance. As soon as I installed the "better_messages" module, the site went down. So I was unable to uninstall the module through UI.

  1. Renamed the module to old_better_messages in modules folder.
  2. Through the url, ran http://IP:port/foldername/rebuild.php. This ensured that site is back, but only in read-only mode. I couldnt do the admin activities or edit articles.
    If rebuild.php or update.php is not working add the line to settings.php
  3. $settings['rebuild_access'] = TRUE;

  4. Used following command to delete the entry from database (using DBvisualizer)
  5. DELETE FROM key_value WHERE collection='system.schema' AND name='better_messages';In my case, there was no entry in the database.

  6. Then using DBvisualizer, I deleted entries from all the tables that starts with cache.
  7. DELETE FROM cache_bootstrap;
     
     
    DELETE FROM cache_config;
     
    DELETE FROM cache_container;
     
    DELETE FROM cache_data;
     
    DELETE FROM cache_default;
     
    DELETE FROM cache_discovery;
     
    DELETE FROM cache_dynamic_page_cache;
     
    DELETE FROM cache_entity;
     
    DELETE FROM cache_menu;
     
    DELETE FROM cache_render;
     
    DELETE FROM cache_toolbar;
     
    DELETE FROM cachetags;
    
    
  8. If the issue is not resolved, delete the renamed module and repeat the steps again. Sometime, though you rename the module, the code still refers to it.
prakash.d’s picture

Issue summary: View changes

Thanks.
i did using these steps
1)Manually delete module from module folder.
2)delete that module from key_value table
3)clear catches through UI.
Done.

alarhby’s picture

Dear soumyapsadanandan
thank you so much for your support , your way saved my site.
thank you.

vishalkhapre’s picture

Actually, these steps by Soumya helped, and site was back. That started another issue where it started giving error when I tried to install other modules. I tried several different combinations the procedures above with and without module on filesystem.

Drupal\Core\Extension\Exception\UnknownExtensionException: The module XXXX does not exist. in Drupal\Core\Extension\ExtensionList->getPathname() (line 522 of /home/customer/www/new.dfwmm.org/public_html/core/lib/Drupal/Core/Extension/ExtensionList.php).

Here is what solution for this.
1) Select the row from database as below
SELECT * FROM `config` WHERE name like '%core.extension%' ORDER BY `name` ASC
2) download the 'data' column into a file, it is serialized data.
3) Use the website https://serializededitor.com/ to deserialize the serialized object. You can do all on the website
4) On website, remove the particular module node.
5) Save the object to a file
6) Update the column 'data' in that row, you can delete the row and add new one. However you prefer.

Then rebuild the site using the https://site/core/rebuild.php, add $settings['rebuild_access'] = TRUE; to settings if that does not work.
That removed the pending entry from system about the module.
You can also write a php program to deserialize, and serialize back if you want. The site just made it easier.

Cheers!!