When moving K2 to a new server with a different hostname, previously running workflows will show a message that they cannot find the hostname of the previous server.
Process Instances in K2 Workspace / K2 Management will end up with an error that looks like this:
"1 Unable to connect to HOSTNAME on port 5252. A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond."
The most important thing is to check and confirm that your Environment Library and String Tables entries are all pointing to the correct locations. For example, the Connection String building up the "Workflow Server" entry should point to the correct K2 server farm name. Restart the K2 server service after making any changes.
After you are certain that all instances of a workflow are using the correct variables, but your workflow is still referring to an old/previous K2 server farm name, then you can proceed to modify the HOSTS file.
Please open Notepad as Administrator, then browse to the following location and open this file:
Add this entry at the bottom of the file:
Please replace "OLDFARMNAME" with the farm name of the previous K2 Server (preferably in FQDN format) and save the file, then restart the K2 Service.
Please use the "Retry" button on workflow instances in error state.