How do you migrate option that are reused by multiple option sets when active option values are a subset of the original option?

How do you migrate option that are reused by multiple option sets when active option values are a subset of the original option?

Our approach involves identifying the active option values for the option and creating only those values per option for the products linked to the option set. (e.g., Optionset-1 is using the Option: Size with values S,M, L and Optionset-2 is reusing the Option: Size with values S, L then all products associated with Optionset-2 will have the size option only with S, L as values)