Make sure you have a complete backup of your Lightroom Catalogs, original images, presets (if any) and your serial key so that you can get them all up easily once you reinstall Lightroom after getting it upgraded.
Do I have to deactivate the programme on the old iMac first? Does it mean that I have to activate the programme agin on the new iMac and does that count as a second activation of the programme and that I can no long install the software also on a laptop?
Yes, you can go to help menu and choose Sign out to deactivate it.
It would be fine even if that option is unavailable as you can install it on two machines.