• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Resetting the Image numbers r4602

    Scheduled Pinned Locked Moved
    Tutorials
    2
    4
    2.0k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Wayne WorkmanW
      Wayne Workman
      last edited by Wayne Workman

      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:

      ALTER TABLE images AUTO_INCREMENT = 1;
      

      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

      Thanks.

      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
      Daily Clean Installation Results:
      https://fogtesting.fogproject.us/
      FOG Reporting:
      https://fog-external-reporting-results.fogproject.us/

      1 Reply Last reply Reply Quote 0
      • Wayne WorkmanW
        Wayne Workman
        last edited by Wayne Workman

        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:
        https://forums.fogproject.org/topic/8762/change-image-id-number

        #wiki worthy

        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
        Daily Clean Installation Results:
        https://fogtesting.fogproject.us/
        FOG Reporting:
        https://fog-external-reporting-results.fogproject.us/

        1 Reply Last reply Reply Quote 1
        • Z
          zaboxmaster
          last edited by

          @wayne-workman said in Resetting the Image numbers r4602:

          SELECT imageID FROM images ORDER BY imageID LIMIT 1;

          Can I just say thank you for this.

          1 Reply Last reply Reply Quote 1
          • Wayne WorkmanW
            Wayne Workman
            last edited by

            FYI, there is now a tool that can renumber your images for you, here it is:
            https://github.com/FOGProject/fog-community-scripts/tree/master/RenumberImageIDs

            Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
            Daily Clean Installation Results:
            https://fogtesting.fogproject.us/
            FOG Reporting:
            https://fog-external-reporting-results.fogproject.us/

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post

            161

            Online

            12.0k

            Users

            17.3k

            Topics

            155.2k

            Posts
            Copyright © 2012-2024 FOG Project