How to upgrade AD RMS from Windows Server 2012 to Windows Server 2019

I need help ! I've installed AD RMS on Windows Server 2012 and installed Windows Server 2019 too. How to move from AD RMS on Win Server 2012 to Win Server 2019 ? I want to upgrade to 2019 and remove Win Server 2012. I want sync template.

Info: I created template on Win Server 2012 and access client connect complete. Win Server 2019 created AD RMS new

Thanks