In QMM 8.7 a mail sync job was created with server A, but later it was discovered that server A is having issues and decision was made to use the server B as agent host.
Old mail job (server pair) has been deleted, changes have been committed. Exch server has been associated with the new agent host, agents have been installed, new job has been created, but the GUI is still referencing the server A as agent host, even after removing all agents from server A.
When using the Agent Manager it is impossible to remove (delete) the server A from the database, the error informs that this agent is involved in other jobs or has collections associated.
Developers confirmed this is a bug. When you delete a job then all the info is deleted from the SQL DB, except the info about the All Mailboxes collection.
When you delete a job then for the All Mailboxes collection the TargetID changes to =0, but the info about the server remains.
In this case the info about the server A was stored in the All Mailboxes collection.
Create a new mail job. Go to All Mailboxes collection properties and look up the source and target servers and change the entry to the desired server, in this case to Server B, and close with OK.
The GUI will immediately reflect the server B as agent host and you can proceed with collection creation.
This issue was reproduced and confirmed by developers and an official Change Request has been created: CR80389