Getting Started with ThingWorx > Installing and Upgrading ThingWorx > Modifying the Location of the ThingWorxStorage Folder
  
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 /
It is recommended to perform this process before starting Tomcat, but if Tomcat is not stopped, restart after modifying 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/tomcat8/8.0.33/conf
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 Storage and BackupStorage folders using the format in the following example. In this example, everything is contained under one root directory named /ThingworxStorage.
* 
Prior to 7.0, the platform-settings.json file and all modelproviderconfig.json files (one for each possible persistence provider) were separate files. Each file contained not only configuration values, but also configuration definitions (data shapes) describing the types, defaults, etc. for those values. For 7.0, the platform-settings.json file and all modelproviderconfig.json files were merged. This was done to reduce the number of configuration files. In addition, all data shapes were removed to significantly reduce the file's verbosity and structure complexity, as well as to greatly simplify its format.
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.
* 
DO NOT TURN THIS ON UNLESS INSTRUCTED 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.
* 
Avoid pasting any unnecessary formatting characters when copying the following to a valid JSON file.
Script Example for Non-Windows

{
"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=="
}
}

}