Drupal - How can I re-install a module?
The Devel module can also help here.
It makes a "Reinstall modules" page available at /devel/reinstall, which lets you re-install modules in bulk.
It's also worth mentioning Drush; dis
(obviously) doesn't work any more, but pm-uninstall
and en
still do. And if you have Devel installed, you can invoke a reinstall with
drush dre module1 module2
As you said "Disable functionality is removed from Drupal 8" ..
The short answer is - you probably are looking for the "Uninstall" tab found on the "Extend" (Modules) page /admin/modules/uninstall
There is no longer any grey area between a module being on and active vs off and "purged". "Disabled" is no longer a thing. Uninstalling a module means removing all traces of it.
Go to admin/modules/uninstall and uninstall module... Then enabled the module from modules list page. That should install the module again.
For Example ....
Before Installing Ban Module in Drupal 8 ... ban_ip module doesn't exist in database..
After Installing Ban Module in Drupal 8... ban_ip table is created and module cannot be disabled but can be uninstalled in admin/modules/uninstall
Now if you uninstall module.. Table will be removed from database and module can be installed again which will create tables in the database..
Solution 1: Uninstall and Install again manually
Using the Drupal UI:
- Go to the Extend page from the admin menu
- Go to the uninstall module page
- Uninstall the module you wish to
- Go to the Extend page again (where you have a list of modules)
- Install the module you just uninstalled
Using Drush (you should try it if you don't use it):
drush pm-uninstall MODULE -y && drush pm-enable MODULE -y
- OR in short
drush pmu MODULE -y && drush en MODULE -y
Replace MODULE with the name of your module.
Solution 2: Reinstall using Devel module
Assuming you have the devel module installed.
Using Drupal UI:
- Visit the path
/devel/reinstall
- Re-install the modules you wish to
Using Drush:
drush devel-reinstall MODULE -y
- OR in short
drush dre MODULE -y
Replace MODULE with the name of your module.