Reinstalling Build agent without losing history

Answered

I'm reviewing my teamcity agent hardware configurations. There's some minor differences and I'll be moving agents to a new location soon. The straightforward solution is to uninstall the agent and do a new installation. I'm running into a problem though. If I use the old agent name without removing the agent on teamcity, the agent stays disconnected and a new one connects with -1 appended to the name. If I remove the old agent on teamcity I can use the old name, but I lose the build history.

How can I do a new installation, keep the agent name, and keep the build history on teamcity? For jobs I can transfer history from another job, is there something similar to this for agents?

1 comment
Comment actions Permalink

Hello,

Agent has a property named authorizationToken which is used by the server to tell the agents apart. This property is saved in the <buildAgentInstallDir>/conf/buildAgent.properties file after the first authorization on the server; if you copy the token over into a new agent installation (or a whole buildAgent.properties file, to also keep the name, folders and custom agent parameters if any), build history should be retained.

0

Please sign in to leave a comment.