Resetting the Image numbers r4602

  • Moderator

    At work, our image IDs have reached into the 100s, it’s kinda ridiculous… because the lowest one is in the 80s I think.

    I just reset my image IDs at home, going to try it at work tomorrow. Here’s what I did.

    Figured out what my lowest Image ID was with this:

    SELECT imageID FROM images ORDER BY imageID LIMIT 1;

    The above query returned “7” for me on my home FOG server.

    Then reset my image IDs in the images table, the imageGroupAssoc table, and the hosts table like this using the information provided by the previous query.

    UPDATE images SET  imageID  = imageID - 7;
    UPDATE imageGroupAssoc SET  igaImageID  = igaImageID - 7;
    UPDATE hosts SET  hostImage  = hostImage - 7;

    I then reset the auto-increment on the images table like this:


    I’d like for one of the @Developers or @Moderators confirm or deny that I’ve done this correctly and it won’t cause any issues. Everyone else is of course welcome to chime in as well.

    it SEEMS to have worked… but I’m asking to be safe…
    Screenshot 2015-09-16 at 10.16.12 PM.png

    Screenshot 2015-09-16 at 10.17.22 PM.png


  • Moderator

    Following up here (a year later, yes I’m terrible).

    I did this at work, it went fine.

    Also, here’s a related thread that deals with the same issue but had problems:

    #wiki worthy

Log in to reply

Looks like your connection to FOG Project was lost, please wait while we try to reconnect.