The Application Data Directory is the folder that OpenMRS uses for external storage of data. Most data is stored in the database but some large files and other things that are not appropriate for a relational database.
Default location
As of version 1.8, openmrs will put this directory in the current running directory. If you are using tomcat this is /opt/tomcathome/.openmrs or C:\Program Files\Apache\Tomcat 6.0\OpenMRS
In version 1.7 and earlier, the default location is the home directory of the user running tomcat. ~/yourusername/.openmrs or C:\Docs and Settings\yourusername\Application Data\OpenMRS
Manually setting the location
You have several options if you want to have control over where this directory is:
- Add a key to your runtime properties file:
- application_data_directory=/my/custom/location/
- Modify the openmrs.war file: /WEB-INF/web.xml file
- Change the context parameter "application.data.directory" to something. (use a trailing slash)
- Modify the conf/Catalina/openmrs/context.xml file in your tomcat (or other server) config:
<Context ...> ... <Parameter name="application.data.directory" value="/my/custom/location/" override="false"/> ... </Context>
(see http://tomcat.apache.org/tomcat-6.0-doc/config/context.html for more info)
For Developers
There are several convenience methods to help developers findSee the methods:
OpenmrsUtil.getApplicationDataDirectory()
and
OpenmrsUtil.getDirectoryInApplicationDataDirectory(String folderName)