Set driver variable ID-block using python
Assuming you only have one driver, and that one driver has only one variable, you can do this. after copying the object data:

copy.animation_data.drivers[0].driver.variables[0].targets[0].id = copy


If you have additional drivers and / or variables, you'll need to find better logic to access these. If you can upload a blend file, it will be easier to tell what the best method is.