Installation and Configuration > ThingWorx Configuration Resources
ThingWorx Configuration Resources
Modifying the Location of the ThingWorxStorage Folder
ThingWorx utilizes two top-level directory folders for storage: ThingworxStorage stores all active information (data, logs, extensions, etc.) and ThingworxBackupStorage stores all backup information. By default, ThingWorx creates these folders in the root directory.
On Microsoft Windows, the root directory is <drive>:\\ where <drive> is the drive Tomcat is installed on
On a non-Microsoft Windows system, the root directory is /
Customize the location of the ThingworxStorage folder before starting Tomcat. If you change the location and Tomcat is not stopped, restart Tomcat after changing the location of ThingworxStorage.
.
Specifying a Custom Location for ThingworxStorage
To modify the location of ThingWorxStorage in the file system, point to the location of the JSON configuration file that specifies the storage locations. You can do this one of two ways:
1. Create a root directory named ThingworxPlatform.
On Microsoft Windows, this is <drive>:\\ThingworxPlatform where <drive> is the drive Tomcat is installed on
On non-Microsoft Windows, this is: /ThingworxPlatform
-OR-
2. Define an environment variable as a system variable (not as a user). The environment variable should be the path only. Do not include platform-settings.json
%THINGWORX_PLATFORM_SETTINGS% (Microsoft Windows)
$THINGWORX_PLATFORM_SETTINGS (non-Microsoft Windows) that points to the location of the JSON configuration file
* 
Ubuntu recommends defining system-wide environment variables in /etc/environment. In this file, you must define and export the THINGWORX_PLATFORM_SETTINGS variable. For example, export THINGWORX_PLATFORM_SETTINGS=/usr/share/tomcatx/x.x.xx/conf, where x is the version of Tomcat you are using.
3. For RHEL only, define the THINGWORX_PLATFORM_SETTINGS variable where the Tomcat service can access it, such as the tomcat.service file or startup script.
* 
System services do not inherit any context (such as the HOME and PATH environment variables) from the invoking user and their session. Each service runs in a clean execution context.
Format Example
After defining the location of the JSON configuration file, create a platform-settings.json file in the location specified above. Modify the locations of the ThingworxStorage and ThingworxBackupStorage folders using the format in the following example. In this example, everything is contained under one root directory named /ThingworxStorage.
Each setting within this file is optional. If a setting is not specified within this file, ThingWorx will default to a hard-coded value at runtime.
SETTING
DESCRIPTION
DEFAULT
Core Platform Settings
BackupStorage
Directory where backup storage directory is created/located.
/ThingworxBackupStorage
DatabaseLogRetentionPolicy
Number of days to retain database logs. Do not modify this unless instructed to by ThingWorx support.
7
EnableBackup
Governs if backups are enabled.
True
EnableHA
Governs if the platform is to be configured for a highly-available (HA) landscape.
False
EnableSystemLogging
Governs if system logging is enabled.
* 
Use only if directed to do so by ThingWorx Support.
False
HTTPRequestHeaderMaxLength
The maximum allowable length for HTTP Request Headers values.
2000
HTTPRequestParameterMaxLength
The maximum allowable length for HTTP Request Parameter values.
2000
Storage
Directory where all storage directories are created/located (excluding Backup storage).
/ThingworxStorage
HA Settings
Settings specific to a highly-available (HA) landscape configuration. Optional, and ignored if the EnableHA setting (above) is set to false
CoordinatorConnectionTimeout
How long to wait (in milliseconds) for a connection to be established with process/server used to coordinate Platform leadership
15000
CoordinatorHosts
A comma-delimited list of server IP addresses on which the processes used to coordinate Platform leadership exist (e.g. "127.0.0.1:2181, 127.0.0.2:2181").
127.0.0.1:2181
CoordinatorMaxRetries
The maximum allowable number of retries that will be made to establish a connection with the process/server used to coordinate platform leadership.
3
CoordinatorRetryTimeout
How long to wait (in milliseconds) for each retry attempt.
1000
CoordinatorSessionTimeout
How long the platform's session is to wait (in milliseconds) without receiving a heartbeat from the process/server used to coordinate platform leadership
60000
LoadBalancerBase64EncodedCredentials
The Base64-encoded credentials for the HA Load Balancer, in the format of “<user>:<password>”.
PersistenceProviderPackageConfigs
Dependant on your database option.
See Persistence Providers for all possible configurations.
Script Example for Non-Windows
Avoid pasting any unnecessary formatting characters when copying the following to a valid JSON file.

{
"PlatformSettingsConfig": {
"BasicSettings": {
"BackupStorage": "/home/johndoe/Developer/thingworx/platform/backup",
"DatabaseLogRetentionPolicy": 7,
"EnableBackup": true,
"EnableHA": false,
"EnableSystemLogging": false,
"HTTPRequestHeaderMaxLength": 2000,
"HTTPRequestParameterMaxLength": 2000,
"Storage": "/home/johndoe/Developer/thingworx/platform/storage"
},
"HASettings": {
"CoordinatorConnectionTimeout": 15000,
"CoordinatorHosts": "127.0.0.1:2181",
"CoordinatorMaxRetries": 3,
"CoordinatorRetryTimeout": 1000,
"CoordinatorSessionTimeout": 60000,
"LoadBalancerBase64EncodedCredentials": "QWRtbW4pc1RyYXRvajphZG1pbg=="
}
}

}
Script Example for Windows
{
"PlatformSettingsConfig": {
"BasicSettings": {
"BackupStorage": "C:\\Users\\John Doe\\Developer\\thingworx\\platform\\backup",
"DatabaseLogRetentionPolicy": 7,
"EnableBackup": true,
"EnableHA": false,
"EnableSystemLogging": false,
"HTTPRequestHeaderMaxLength": 2000,
"HTTPRequestParameterMaxLength": 2000,
"Storage": "C:\\Users\\John Doe\\Developer\\thingworx\\platform\\storage"
},


"HASettings": {
"CoordinatorConnectionTimeout": 15000,
"CoordinatorHosts": "127.0.0.1:2181",
"CoordinatorMaxRetries": 3,
"CoordinatorRetryTimeout": 1000,
"CoordinatorSessionTimeout": 60000,
"LoadBalancerBase64EncodedCredentials": "QWRtbW4pc1RyYXRvajphZG1pbg=="
}
}

}
Was this helpful?