Updating a RabbitMQ Password > Update a RabbitMQ Password – Windows
Update a RabbitMQ Password – Windows
Overview
If you install the instance of RabbitMQ provided with the Platform Analytics installer, the password is encrypted by default during installation. If, at some point, you need reset the RabbitMQ password, it must be updated in both ThingWorx and the Property Transform microserver. Follow the procedures below to complete all the necessary tasks.
Update the Password in RabbitMQ
To update a RabbitMQ password, make all of the following updates:
1. Open the Windows PowerShell, or a Command Prompt, in Administrator mode.
2. Navigate to the following location in your Platform Analytics installation directory:
<platform_analytics_install>\RabbitMQ\rabbitmq_server-3.7.7\sbin
For example:
C:\Program Files (x86)\ThingWorxAnalytics\PlatformAnalytics\RabbitMQ\rabbitmq_server-3.7.7\sbin
3. Run the following command:
rabbitmqctl.bat change_password <RabbitMQ username> <new password>
4. Navigate to the local services on your computer. The path to these services will vary based on your version of Windows. (Example: Administrative Tools > Services) and restart the following RabbitMQ and Flink services:
twpas-rabbitmq-service
twpas-flink-service
Update the Password in ThingWorx
1. Open the Windows PowerShell, or a Command Prompt, in Administrator mode.
2. Navigate to the bin directory of the Security Management Tool.
* 
The Security Management Tool was downloaded and configured the first time you manually encrypted the RabbitMQ password. To review that procedure, see the Configure Property Transform Settings in ThingWorx and navigate to the Encrypt the RabbitMQ Password section.
3. Run the following command:
security-common-cli.bat keystore.conf set encrypt.propertytransform.password "<new RabbitMQ password>"
4. Restart ThingWorx.
Update the Password in the Property Transform Microserver – Scripted Process
This scripted procedure is available for Platform Analytics version 8.4.4 or later. The encryption script automates most of the steps involved in updating an encrypted password. It eliminates the manual work of copying randomly generated Key Store directory and file names and plugging them into a complex Java encryption command. The encryption script is stored in the install bin directory and is launched with a simple command that requires two parameters.
If you are using a Platform Analytics version earlier than 8.4.4, use the Manual Process.
1. Open the Windows PowerShell, or a Command Prompt, in Administrator mode, and navigate to the bin directory where your Platform Analytics is installed:
C:\Program Files (x86)\ThingWorxAnalytics\PlatformAnalytics\bin
2. Execute the following command to run a script that will update the encryption of your new RabbitMQ password:
update-encrypted-password.bat r <new RabbitMQ password>
A message is displayed when the encryption process is complete and the command prompt returns.
3. Navigate to the local services on your computer. The path to these services will vary based on your version of Windows. (Example: Administrative Tools > Services) and restart the following Property Transform service:
twpas-property-transform-service
Update the Password in the Property Transform Microserver – Manual Process
Use the procedure below to manually update and encrypt the RabbitMQ password in the Property Transform microserver. If you are using Platform Analytics version 8.4.4 or later, you can use an easier scripted process to encrypt the new password. For more information, see the Scripted Process.
1. Open the Windows PowerShell, or a Command Prompt, in Administrator mode.
2. Locate the randomly-assigned key store folder names for Property Transform as follows:
Navigate to the C:\Program Files (x86)\ThingWorxAnalytics\PlatformAnalytics directory.
Open theplatform-analytics-environment.properties file.
In the #keyStore section, make note of the following alphanumeric folder names that are randomly assigned during Property Transform installation:
key.store.directory
key.store.password.directory
key.store.password.file
key.store.file
Example folder names:
3. Run the following command, replacing the angle brackets with the randomly assigned alphanumeric folder names:
java -cp ccc-platform-bin.jar com.thingworx.analytics.ccc.platform.encryption.Encryptor <new_rabbit_mq_password> <key.store.password.directory> <key.store.directory> <key.store.password.file folder> <key.store.file folder> rabbitMQKey
Example command:
java -cp ccc-platform-bin.jar com.thingworx.analytics.ccc.platform.encryption.Encryptor updatedRabbitMQPassword /C:/PROGRA~2/THINGW~1/PLATFO~1/988f188b /C:/PROGRA~2/THINGW~1/PLATFO~1/d18429a3 2e3bb250 cd0e1544 rabbitMQKey
4. Navigate to the local services on your computer. The path to these services will vary based on your version of Windows. (Example: Administrative Tools > Services) and restart the following Property Transform service:
twpas-property-transform-service
Was this helpful?