How to manually remove modules?

Platform Version: **OpenMRS Version:**1.11.x

Question: How do I manually remove modules?

I installed some modules and they have corrupted my installation, so I can’t use the webapp to remove the offending modules. I have tried deleting them but somehow they reappear after I restart the webapp.


If you are using Windows - C:\Users{username}\Application Data\OpenMRS\modules\ is where the modules get stored If you remove the modules there, it wont get loaded next time you start the server. So, but even if you are in any other Operating system, you might try searching for .omod and if you find it under \OpenMRS\modules\ that might be the correct place. And actually it can be in a hidden folder in Mac so make sure you unhide all your hidden folders and files before the search.

1 Like

Thanks for the quick response.

I installed tomcat and deployed the webapp.

When I used the webapp to install modules, it created folders in

tomcat\webapps\openmrs\WEB-INF\view\module for each module.

These are the module dependencies which I downloaded from the module repository on the web and which have actually corrupted my installation.

It did not actually do anything with the omod which I changed and deployed to AppData\OpenMRS\modules.

The folders in tomcat\webapps\openmrs\WEB-INF\view\module are recreated everytime I restart the tomcat and the webapp.

So basically an omod is a compressed set of files similar to a zip or war, the way OpenMRS handles omods is when you load a module through the web interface the module is saved in the AppData folder and it is extracted to the tomcat\webapps\openmrs\WEB-INF\view\module for each module. So if you replace an omod in AppData with a modified omod it should generally extract and replace the WEB-INF folder with the files in the new omod.

Similarly if you remove the omod from the AppData the files should not be recreated as it doesn’t have a source. There should be something you are missing from this process.

  1. Stop Tomcat.
  2. Delete the files from the tomcat\webapps\openmrs\WEB-INF\view\module directory.
  3. Delete the omod from the AppData directory.
  4. Start Tomcat.

This should make sure that the module does not start with openmrs this time and hence no files should be extracted.

And for further reference, provide more data about your issue , like which operating system, what module you are trying to load. How/in what way did it corrupt your installation. It would be hard to help without any information about these.

1 Like

I was working on adminui and need to make a change in uicommons.

I loaded uicommons with the webapp and it said I needed certain dependent modules.

I loaded appframework, appui, uiframework. When I loaded providermanagement it said I needed uilibrary. Somehow the uilibrary downloaded from the repository was incompatible with providermanagement.

I tried to remove uilibrary but the webapp crashed and now whenever I run it, it gives me an error page saying webapp could not start.

Since your last email, I undeployed the webapp from tomcat which deleted the openmrs folder in tomcat\webapps. I deployed the webapp again to tomcat. This time I copied the adminui.omod to the modules folder. When I started the webapp again the old modules had been recreated in WEB-INF\view\module.

I am running windows 8.1, java 1.6, openmrs 1.11.x.

Thanks for helping me.

I have figured it out now, and I have got it to work.

Well the first thing is the Application Data folder in windows 8.1 is

C:\Users\James\AppData\Roaming\OpenMRS. The first time after I built openmrs I run it with jetty and jetty had no problem recognizing and creating the proper AppData\OpenMRS folder.

When I started using tomcat, somehow tomcat did not recognize this AppData folder. When I used the webapp to install the modules, with tomcat the omods were installed in

C:\Users\James.m2\repository\org\openmrs\module which is part of the maven repository.

To correct the problem I set the AppData folder in the WEB-INF\web.xml parameter

Thanks for your help.