The key is in /etc/ssh
, should be various ssh_host_*
files. If you move those over, then the clients will continue to recognize it (presuming, as user4556274 points out, the host name clients use to connect matches).
Also: You may want to confirm the keys' continued adequacy, e.g., if they're long enough (bits) to still be secure enough and also review the OpenSSH news and/or ssh-keygen manpage to see if you want to generate additional keys (e.g., for new crypto algorithms). For example, according to some recommendations RSA and DSA keys should be at least 3072 bits. An old machine probably doesn't have ECC keys (but you should consider generating some).
[I don't know how to upgrade keys on existing clients without getting the key changed warning, so I've asked: How to roll over ssh host keys? ]