Another way of increasing the chances of getting an answer is to provide a complete example of the problem. I'm assuming you are meaning something like this:
package ConnectorsTest
partial model GenericFlow "Flow Template with replaceable ports"
replaceable FlowPort portA "Flow from/to Stock A" annotation(Placement(visible = true, transformation(origin = {-66.537, 24.02}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {-100, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
replaceable FlowPort portB "Flow to/from Stock B" annotation(Placement(visible = true, transformation(origin = {110, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {100, -0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
end GenericFlow;
model Outflow "Outflow from a stock"
extends GenericFlow(redeclare SpecialFlowPort portA);
end Outflow;
connector FlowPort
annotation(Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(visible = true, origin = {0, 5}, fillColor = {107, 255, 252}, fillPattern = FillPattern.Solid, extent = {{-50, -55}, {50, 55}})}));
end FlowPort;
connector SpecialFlowPort
annotation(Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {10, 10}), graphics = {Rectangle(visible = true, origin = {0, 5}, fillColor = {246, 114, 123}, fillPattern = FillPattern.Solid, extent = {{-50, -55}, {50, 55}})}));
end SpecialFlowPort;
end ConnectorsTest;
That should indeed work and it does, at least in WSM 5.1. Perhaps you have an older version? 5.0 contained a lot of improvements regarding replaceable/redeclare.
Otto