Try breaking the ITL file & make iTunes rebuild it
First, move the existing iTunes Library.itl to the desktop, just in case.
Don't touch the .xml, just the .itl file.
It can be found in
Delete the existing ITL if you left a copy in the iTunes folder.
Open Terminal & enter this
touch ~/Music/iTunes/iTunes\ Library.itl That will create an empty ITL file, broken enough for this.
Launch iTunes. It will now notice something is 'wrong' & start rebuilding the ITL file, using your existing XML file. The message is 'Importing ‘iTunes Music Library.xml’ This will take some time, maybe 15 minutes or so, depending on your Library size.
Breaking it rather than not having any .itl file there at all makes the difference between several minutes & several hours for the rebuild.
You may find some album artwork missing - it never seems to be a truly perfect solution, but your play counts, playlists etc should all survive intact.