Unfortunately Segment does not offer an out of the box solution in this exact situation. You have to consider how this might impact all the integrations you are currently using. How will you merge the identity of a previous identified user with the new userId in the integration? What about cached userId's in the wild? Certain integrations do not allow you to update the userId at all. Next you have to ask those same question about your data warehouse. Another solution that may work is maintaining two version of userId's.
I didn't find the right solution from the internet.