Updating ThingWorx AppKeys > For Linux > Update a ThingWorx AppKey for Analytics Server – Manual Process
Update a ThingWorx AppKey for Analytics Server – Manual Process
When you need a new ThingWorx AppKey, use the procedure below to manually update and encrypt the key. If you are using Analytics Server version 8.4.4 or later, you can use an easier scripted process to encrypt the new key. For more information, see Update a ThingWorx AppKey – Scripted Process.
1. Log into ThingWorx Composer, as an Administrator, and create a new AppKey. For more information, see the Application Keys section of the ThingWorx Help Center.
* 
The Application Key you provide to ThingWorx Analytics must be a key assigned to a user with Administrator privileges. After installation, the Application Key can be reassigned to a non-administrator user who has the appropriate permissions. See ThingWorx Application Key Permission Levels.
The same key can be used for both Analytics Server and Platform Analytics.
2. In the installation directory where your ThingWorx Analytics is installed, open a terminal window as the root user and navigate to the properties file at the following path:
/opt/ThingWorxAnalytics/ThingWorxAnalyticsServer/config/system—environment-variables.properties
3. In the #keyStore section, make note of the following alphanumeric folder names that are randomly assigned during ThingWorx Analytics installation:
key.store.directory
key.store.password.directory
key.store.password.file
key.store.file
Example folder names:
Keystore folders
4. Navigate to the /opt/ThingWorxAnalytics/ThingWorxAnalyticsServer directory.
5. Run the following command, replacing the angle brackets with the randomly assigned alphanumeric folder names:
java -cp css-security-bin.jar com.thingworx.analytics.css.security.encryption.Encryptor <new_thingworx_appkey> <key.store.password.directory> <key.store.directory> <key.store.password.file> <key.store.file> twxAnalyticsAppKey
Example command:
java -cp css-security-bin.jar com.thingworx.analytics.css.security.encryption.Encryptor 947845b6-96ce-4d96-ae21-ba35818dc702 /opt/ThingWorxAnalytics/ThingWorxAnalyticsServer/988f188b /opt/ThingWorxAnalytics/ThingWorxAnalyticsServer/d18429a3 2e3bb250 cd0e1544 twxAnalyticsAppKey
6. Navigate to the bin folder:
/opt/ThingWorxAnalytics/ThingWorxAnalyticsServer/bin
7. Use the following command to restart the services:
./twas.sh restart
It might take several seconds for the Things in ThingWorx to refresh and reconnect.
Was this helpful?