If you have your ADFS 2 in a farm mode, then just upgrade it now and put it to a different box: https://docs.microsoft.com/en-us/windows-server/identity/ad-fs/deployment/migrate-ad-fs-service-role-to-windows-server-r2 (same process with Windows Server
2016).
If you have ADFS 2 in a stand alone, reinstall from scratch and re-create all the trust on an other box than a domain controller.
If you use ADFS for the sole purpose of using Office 365, you might not need ADFS at all anymore, see here: https://blogs.technet.microsoft.com/pie/2017/02/06/do-i-really-need-adfs/
Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.