Assign/Set a UserId to a VisitorId

Scenario: Random stranger browsing the site, clicks on external registration form which pushes data to our database, which creates a user in our system. Now with available data to use for setUserId/uid we would like to assign that userid to the visits when the person was a stranger, so we can see what the users journey prior to registering.

Is there anyway to assigned a User Id to an existing Visitor Id?

In short: I would like to assign the prior visits (no userId) to a newly created person that has now been converted to have visits with a userId. Is this possible via the http tracking API?

Thank you.