If a husband and his wife, married in another state or country, come into this commonwealth, either at the same or at different times, and reside here as husband and wife, she shall retain all property which she had acquired by the laws of any other state or country, or by a marriage contract or settlement made out of this commonwealth. Such residence together here shall have the same effect, relative to their subsequent rights and liabilities, as if they had married here at the beginning of such residence.