Application Data Directory on Windows 8 & 10 for Platform 2.x

As we work on UgandaEMR to move to platform 2.x we have found that the location of the application data directory differs from 1.x which was C:\Application Data\OpenMRS now is C:\Windows\system32\config\systemprofile\Application Data\OpenMRS

This causes problems with modules like Database Backup that need to write files to the system, which is adminsitratively protected. Any ideas on how we can override the settings on these platforms to the original C:\Application Data\OpenMRS?

This change of location is not related to platform 2.x but rather the Java and OS combination that you are using. In the runtime properties file, there is a property which you can use named “application_data_directory”

@dkayiwa How do I set this property during installation because the runtime properties file is not yet created

@ssmusoke, you can pass it when starting up tomcat through OPENMRS_APPLICATION_DATA_DIRECTORY command line or system property, e.g. https://github.com/openmrs/openmrs-sdk/blob/6715d7f6cdcd69ebbfc34b28f11ab55493a4731a/maven-plugin/src/main/resources/build-distro/web/setenv.sh

@raff any idea how I would do this on Windows?

Are these of help? https://www.mkyong.com/web-development/how-to-pass-system-properties-in-web-xml/

https://wiki.apache.org/tomcat/HowTo#Can_I_set_Java_system_properties_differently_for_each_webapp.3F