the seal around the sunroof glass normally doesn't fully keep water out, it's like a porous foamy sponge that lets water trickle down onto the draining channels.
so if it's a little dinged it ain't bad, more important to make sure ur sunroof drainage channels & pipes are all clear of any debris.
think the foamy seal is bonded to the glass and don't think the seal's sold separately. the glass itself is simply bolted to the sunroof mechanism with torx bolts and its easier to just replace the glass assembly which is bout £50 ebay I think.
no need to replace the whole sunroof which is a hassle.
You'll probably find the leak is the seal with the glass, quite a common fault.
I tried to re-glue the seal, but no good, the tape fixed it, and the roof operates as normal buddy - try it.