Bulk change the Hardware Asset Primary Key to GUID

Stoyan_ChalakovStoyan_Chalakov Customer IT Monkey ✭
Hi Guys,

my last questions for today. I just realized that I am not following the best practices when creating Hardware Assets, because I use the Serial Number as a Hardware Asset ID (Primary Key). 
No I confîgured the workflow to assign a GUID as the Hardware Asset ID. What happens to the existings H Assets? Do they get also updated?
If not, what would be the easiest way to update them in bulk?

Thanks in advance for the help!

Answers

  • Tony_CollettTony_Collett Cireson Support Super IT Monkey ✭✭✭✭✭
    Hardware Asset Primary Keys are not recommended to change as they are associated with relationships in the database. If you change the Primary Key you can break quite a few things. 

    You do have 2 options: Leave it as is and use the GUID for Hardware Assets from now on, or create a back up of existing records (including what relationships are associated with what assets) and then delete the assets with the incorrect Primary Key/Hardware Asset ID and recreate them with the new GUID and associate all relationships again. 


  • Stoyan_ChalakovStoyan_Chalakov Customer IT Monkey ✭
    Hi Tony,

    sounds quite convincing to me. I think I will leave the current HAs like this (with the Serial Nr. as Primary Key). The second option is something I would do only as a last resort.
    Do you think that having some of them (HAs) with the SN as a primary key and others with GUIDs could actually cause issues?

    Thanks, 
    Regards!
Sign In or Register to comment.