# How to externalize properties files

**URL:** <https://forum.flowable.org/t/how-to-externalize-properties-files/527>\
**Category:** Flowable Engine\
**Created:** [May 4, 2017, 7:25pm UTC](https://forum.flowable.org/t/how-to-externalize-properties-files/527 "2017-05-04T19:25:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![douglascrp](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/douglascrp/32/306_2.png) [@douglascrp](https://forum.flowable.org/u/douglascrp)\
**Post date:** [May 4, 2017, 7:25pm UTC](https://forum.flowable.org/t/how-to-externalize-properties-files/527/1 "2017-05-04T19:25:07Z")

</div>

I am playing with Flowable in a VPS, and in order to make it work, I had to change all the application endpoints in all the applications by touching the file **flowable-ui-app.properties**

Isn’t there a way to add those properties in another path that is not inside **\<app.war\>/WEB-INF/classes/META-INF/flowable-ui-app**?

The reason for asking this is to avoid losing changes in the case Tomcat redeploy the war files.

Thank you

---

<div class="post-metadata">

**Author:** ![douglascrp](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/douglascrp/32/306_2.png) [@douglascrp](https://forum.flowable.org/u/douglascrp)\
**Post date:** [May 4, 2017, 7:33pm UTC](https://forum.flowable.org/t/how-to-externalize-properties-files/527/2 "2017-05-04T19:33:55Z")

</div>

Ok, forget about my question.

Answering my own question, I have just found the answer in the docs

> Usually, you will want to change the default H2 in-memory database configuration to a MySQL or Postgres (or other persistent database) configuration. You can do this per app by changing the flowable-ui-app.properties file in the WEB-INF/classes/META-INF directory of each app. But it’s easier to copy the flowable-ui-app.properties file from one of the apps or get it from Github, and **put it in the Tomcat lib folder. The UI applications will first look at a flowable-ui-app.properties file available on the classpath directly and this configuration will have precedence over the configuration file in the WAR.** To change the default configuration to MySQL the following changes are needed to the properties file:

Thank you anyway

---

<div class="post-metadata">

**Author:** ![pstapleton](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/pstapleton/32/678_2.png) [@pstapleton](https://forum.flowable.org/u/pstapleton)\
**Post date:** [May 5, 2017, 6:11am UTC](https://forum.flowable.org/t/how-to-externalize-properties-files/527/3 "2017-05-05T06:11:53Z")

</div>

Hi,

I thought I would add my own alternative solution. I don’t like the idea of adding the properties file directly to the Tomcat lib directory. I would sooner not clutter up the lib directory with application specific properties like this as it can be a pain to maintain.

Instead, add a context XML file for the tomcat deployment that remaps an external properties file into the WEB-INF directory. This way Flowable will pick it up as being on the classpath even if its outside of the WAR file.  
In practice:

Create a file at `$CATALINA_HOME/conf/Catalina/localhost/flowable-task.xml` with the content:

```
<Context>
  <Resources>
    <PreResources className="org.apache.catalina.webresources.FileResourceSet"
            base="/path/to/external/properties/files/flowable-ui-app.properties"
            webAppMount="/WEB-INF/classes/flowable-ui-app.properties" />
  </Resources>
</Context>

```

You will need a context file for each Flowable app that is deployed (e.g. flowable-idm, flowable-modeler, etc). This then acts as if the the file at `/path/to/external/properties/files/flowable-ui-app.properties` is present at `$CATALINA_HOME/webapps/flowable-task/WEB-INF/classes/flowable-ui-app.properties`

This then allows the properties files to be kept in a specific folder without cluttering up the Tomcat lib folder.

/ Paul

---

<div class="post-metadata">

**Author:** ![douglascrp](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/douglascrp/32/306_2.png) [@douglascrp](https://forum.flowable.org/u/douglascrp)\
**Post date:** [May 5, 2017, 12:44pm UTC](https://forum.flowable.org/t/how-to-externalize-properties-files/527/4 "2017-05-05T12:44:39Z")

</div>

Hey. Thank you for taking the time to answer.

Yes, your idea is good, but for now, I don’t mind having the configuration inside the lib folder, as by doing so, even though it is not the best place, it is in a single place, that I can “control”.

I will consider your approach when I start using Flowable in production.

This is my first test, and this server is just a playground.

Regards.

---

<div class="post-metadata">

**Author:** ![temecom](https://avatars.discourse-cdn.com/v4/letter/t/9fc348/32.png) [@temecom](https://forum.flowable.org/u/temecom)\
**Post date:** [May 9, 2017, 9:00pm UTC](https://forum.flowable.org/t/how-to-externalize-properties-files/527/5 "2017-05-09T21:00:20Z")

</div>

The $CATALINA\_HOME/lib approach did not work for me for some reason and I like the Context XML approach much better since it is Web app specific. However there is a mistake in the above directions for Version 6.1.0 in that the flowable-task.xml should be changed to :

```
<Context>
  <Resources>
    <PreResources className="org.apache.catalina.webresources.FileResourceSet"
            base="/path/to/external/properties/files/flowable-ui-app.properties"
            webAppMount="/WEB-INF/classes/META-INF/flowable-ui-app/flowable-ui-app.properties" />
  </Resources>
</Context>

```

Note the extra path segment /META-INF/flowable-ui-app
