Run teamwork_server_nogui.exe -changeKey -key:<path to the key file location> from the command line.
This is the example for the Windows OS:teamwork_server_nogui.exe -changeKey -key:C:\MagicDraw_18_4_TeamworkServer_key.xml