We are off there next week. We first went there when our child was 5 if I recall, and we had a great time. We have been back at least once a year since then, child is now 10.
The ships are very interesting for all ages and there are also some climbing activities in the Action Stations area...
https://tickets.picniq.co.uk/portsmouth-historic-dockyard/
If this link works they have offers for discounted tickets which allow unlimited access for a while year.
As others have stayed its a great day out with plenty to do for all ages.