You should upgrade the existing current AADConnect version to the latest for your server version.
The ability to export and import the config was added in version 1.5.42.0
https://learn.microsoft.com/en-us/azure/active-directory/hybrid/reference-connect-version-history#15420
Then
Follow this doc to export the config and import to the new server:
https://learn.microsoft.com/en-us/azure/active-directory/hybrid/how-to-connect-import-export-config