Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I am creating on Drupal 8 module. I have used custom table to store the data collected from forms. Somehow during installations tables are not created due to issue in install file. Now i have fixed the issue and want to run installation again.

How can i install module again? As from this and this discussion i know that Disable functionality is removed.

Is there any other way to run install file again so that tables can created properly.

share|improve this question
add comment

2 Answers 2

up vote 4 down vote accepted

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
share|improve this answer
    
Note that devel doesn't yet support Drupal 8's uninstall-only changes cgit.drupalcode.org/devel/tree/drush/devel.drush.inc#n115 –  anavarre Jun 25 at 10:12
1  
I've started an issue to fix that drupal.org/node/2292425 –  anavarre Jun 25 at 12:23
add comment

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..

enter image description here enter image description here

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

enter image description here enter image description here enter image description here

Now if you uninstall module.. Table will be removed from database and module can be installed again which will create tables in the database..

enter image description here enter image description here

share|improve this answer
    
Thanks a lot for such awesome explanation. I checked the list of modules in uninstall tab, but couldn't found my module. If you want to check code here github.com/mohit-rocks/messaging . Currently you can install module and settings related forms are coming. –  mohit_rocks May 10 at 9:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.