I would just deactivate first to be sure. Then reactivate the licences once you replace the HDD. And keep in mind any video content is linked to the hard drive so you'll lose it for good.
I think your digital licenses are safe during a HDD swap but you can never be too careful. I lost video content on a console that died and can't dl videos now and actually watch em.
You can contact Sony directly and have them reset the Video license. Thats never been an issue. It is a security/piracy issue which is why you can only download movie purchases to only one console. Sony doesn't like doing it, but if you're courteous and explain, then they should have no problem doing it.
Its always a good idea to deactivate the console before hand, and then re-activate it after the new hdd install