/
Application Data Directory

Application Data Directory

This page is outdated and no longer receives updates!

The Application Data Directory is the folder that OpenMRS uses for external storage of data. Typically, this will include things like OpenMRS modules, Lucene indexes, OpenMRS's runtime configuration properties and any attachments. Other files might be added here depending on which modules you have installed.

Location

If you are using Tomcat, the application data directory will be relative to your CATALINA_HOME  environment variable. If Tomcat was installed following the instructions on the Wiki, it will be either /opt/tomcat7/.OpenMRS on Linux or C:\Program Files\Apache\Tomcat 7.0\OpenMRS on Windows. If you are using an SDK server, the application data directory is at ~/openmrs/[serverId] .

In version 1.7 and earlier, the default location is the home directory of the user running tomcat. ~/.OpenMRS on Linux or C:\Documents and Settings\yourusername\Application Data\OpenMRS on Windows.

Setting the location

You have several options if you want to have control over where this directory is:

  1. Add a key to your runtime properties file:

    • application_data_directory=/my/custom/location/

  2. Setup the CATALINA_OPTS  environment variable for the user running Tomcat to include -DOPENMRS_APPLICATION_DATA_DIRECTORY=<path>.

  3. Modify the conf/Catalina/openmrs/context.xml file in your tomcat (or other server) config:

  4. Modify the openmrs.war file: /WEB-INF/web.xml file

    • Change the context parameter "application.data.directory" to whatever directory you want.

For Developers

There are several convenience methods to help developers findSee the methods:

OpenmrsUtil.getApplicationDataDirectory()

and

OpenmrsUtil.getDirectoryInApplicationDataDirectory(String folderName)

 

Related content

Implementer Documentation
Implementer Documentation
Read with this
Multiple Instances of OpenMRS
Multiple Instances of OpenMRS
More like this
OpenMRS Concept Cooperative (OCC)
OpenMRS Concept Cooperative (OCC)
Read with this
Application Configuration
Application Configuration
More like this
Mobile use cases
Mobile use cases
Read with this
Overriding OpenMRS Default Runtime Properties
Overriding OpenMRS Default Runtime Properties
More like this