Before asking, you could think how OCS work ...
When an agent run on a computer for the first time, it calculate an identifier like 'hostname-2022-05-02-15-19-21', save it and send inventory to the server. (For the first time means agent check if identifier exist in data folder)
The server create a row in table 'hardware' with field DEVICEID = identifier, and also a field with hostname.
- first, if you unistall agent (and clear all data) and reinstall agent, the identifier is erased so a new will be calculate and a duplicate appears, (when you upgrade, the identifier is not erased and no duplicate)
- second, the DEVICEID include hostname, so before change it, you have to consider to remove the hardware !
If you look 'activity.log', you can see the DEVICEID on each lines ...