7.4. Migrating from a JAR Installation to an RPM Installation
When an agent is initially installed from the JAR file available with the JBoss ON server downloads (Chapter 6, Installing and Upgrading an Agent on a Managed Platform from the JAR File), it is possible to switch the agent to an RPM installation. There are two potential paths. Either the old agent can be scrapped and a new agent installed (which loses all of the original agent configuration and data) or the agent data can be migrated from the original JAR installation to the new RPM installation.
7.4.1. Converting an Agent (Losing Configuration Data)
This method loses all of the original data for the agent, including the persistent store, data directory, and logs. However, by re-using the original security token, the agent can re-register with the server and retrieve its previous inventory and resource histories and configuration, so none of the management information for the platform is lost.
- Retrieve the security token for the agent.
- Click the Administration tab and select the Agents link under the Topology section on the left.
- Select the agent from the list, and click its name to open its details page.
- Copy the security token.
- Shut down the agent.
- Remove the JAR installation directory.
- Install the agent RPM.
- Edit the
agent-configuration.xml
file and add a line for the original security token for the agent.vim /etc/jboss-on/agent/agent-configuration.xml <entry key="rhq.agent.security-token" value="abcd1234" />
- Run through the agent configuration installer.
[jsmith@server ~]$ sudo service jon-agent config
- Start the agent.
[jsmith@server ~]$ sudo service jon-agent start
7.4.2. Migrating an Agent to an RPM (Preserving Configuration Data)
It is possible to preserve the JVM and persisted data for the agent, which maintains all of the original configuration data. However, this requires accessing the Java store through a Java preferences browser in the original agent and copying it into the Java store for the new agent, without affecting any other data in the store. There is always a risk when editing Java stores.
- Shut down the original agent.
- Install the agent RPM.
- Copy over the previous configuration directories for the agent. This includes the data directory (which contains operational information like the changesets for drift detection or truststores used for SSL) and the log directory. For example:
[root@server ~]# cp -r agentRoot/rhq-agent/data/ /var/lib/jboss-on/agent/data/ [root@server ~]# cp -r agentRoot/rhq-agent/logs/ /var/log/jboss-on/agent/
- Using a Java preferences editor, export the Java preferences specific to the agent from the original preferences store in
~/.java/.userPrefs/rhq-agent/default
(by default).NoteBe sure to retrieve the security token. The token allows the agent to re-register with the server successfully. - Using a Java preferences editor, import the Java preferences for the agent into the new preferences store in
/var/lib/jboss-on/agent/prefs/default
(by default). - Run through the agent configuration installer.
[jsmith@server ~]$ sudo service jon-agent config
- Start the agent.
[jsmith@server ~]$ sudo service jon-agent start