Copy the entity ID from the old device. Delete it. Add new device and change the entity ID of the new one to the old.
It would be great if they built a device replacement function that would intelligently swap all the entities from an old device to a new one.