<h2>MID server fails to validate after copying the directory from old to new host</h2><br/><div style="overflow-x:auto"><article><div ><h3 >Issue </h3><section><div class="margin"> <div>When a working MID server directory is copied from another host instead of doing a fresh install, it fails to validate.</div> <h3>Scenario</h3> <div>MID Server Directory was copied from a working host to a new host to create a new MID server. The <span style="font-family: courier new,courier;">config.xml</span> file was edited with the new MID server name. The MID Server record was created in the instance and shows that the MID server is up, but it cannot be validated.</div> <div><br />The following log entry appears in the <span style="font-family: courier new,courier;">Agent.log.0</span> file.</div> <div> </div> <pre>---- 09/22/17 13:49:34 (983) StartupSequencer Agent record not found, creating new record. Instance: XXXXX213; 09/22/17 13:49:35 (045) StartupSequencer SEVERE *** ERROR *** Unable to load keystore: Unexpected IOException loading KeyStore, caused by: Keystore was tampered with, or password was incorrect&#13; 09/22/17 13:49:35 (045) StartupSequencer SEVERE *** ERROR *** Keystore and config.xml files out of sync. 1) Delete keystore/agent_keystore.jks or restore config.xml to its previous state, 2) ensure MID server has write permissions to config.xml and to keystore directory, 3) restart MID server.&#13; 09/22/17 13:49:35 (045) StartupSequencer WARNING *** WARNING *** Encountered error: [Unable to load keystore] while starting up the service. Retry...&#13; 09/22/17 13:49:35 (154) StartupSequencer WARNING *** WARNING *** Unable to get agent record while setting validation status, retry in 5 seconds&#13; 09/22/17 13:49:40 (217) StartupSequencer WARNING *** WARNING *** Unable to get agent record while setting validation status, retry in 5 seconds&#13; 09/22/17 13:49:45 (280) StartupSequencer WARNING *** WARNING *** Unable to get agent record while setting validation status, retry in 5 seconds&#13; 09/22/17 13:49:50 (280) StartupSequencer SEVERE *** ERROR *** Unable to change mid server validation status to validation_failed&#13; 09/22/17 13:50:50 (639) StartupSequencer Agent record not found, creating new record. Instance: XXXXX213; 09/22/17 13:50:50 (639) StartupSequencer SEVERE *** ERROR *** Unable to load keystore: Unexpected IOException loading KeyStore, caused by: Keystore was tampered with, or password was incorrect&#13; 09/22/17 13:50:50 (639) StartupSequencer SEVERE *** ERROR *** Keystore and config.xml files out of sync. 1) Delete keystore/agent_keystore.jks or restore config.xml to its previous state, 2) ensure MID server has write permissions to config.xml and to keystore directory, 3) restart MID server.&#13; 09/22/17 13:50:50 (639) StartupSequencer WARNING *** WARNING *** Encountered error: [Unable to load keystore] while starting up the service. Retry...&#13; 09/22/17 13:50:50 (718) StartupSequencer WARNING *** WARNING *** Unable to get agent record while setting validation status, retry in 5 seconds&#13; 09/22/17 13:51:05 (858) StartupSequencer SEVERE *** ERROR *** Unable to change mid server validation status to validation_failed&#13; ----</pre> </div></section></div><div ><h3 >Resolution</h3><section><ol style="list-style-position: inside;"><li>Stop the MID server service.<br /><install-directory><span style="font-family: 'courier new', courier;">\agent\stop.bat.</span></li><li>Check to make sure the MID server is not longer running on the instance.</li><li>Rename the keystore directory.<br /><Install directory><span style="font-family: 'courier new', courier;">\agent\rename</span> <em>keystore</em> <em>keystore.old</em></li><li>Run <span style="font-family: 'courier new', courier;">install.bat</span> from the agent directory and ensure that the instance name, MID username/password are correct.<br />The MID server should now come up in the instance and validation should work.</li></ol></section></div></article></div>