<This bumping gets old 👿>
Note I'm talking about opening the .itl file either by shift starting iTunes or moving/renaming files. Importing an old XML into an existing library may have odd results, stats may not be imported for files that are already in the library and files that are no longer where they were when the XML was created will be ignored.
Each track in iTunes is represented by a unique ID. Ratings & playcounts are attached to those IDs. Unless you routinely remove and then reimport the media, or have swtiched to a completely fresh database file, those IDs should remain relevant. The ExportImport script was written for a user who found that following an update all his stats and possibly some other metadata had been destroyed, but IIRC he'd also consolidated the library, so simply using the old library wasn't an option. Temporarily restoring an old database allowed the stats to be exported, then once the current library, was restored they could be reimported.
The SyncStats script works instead with a library on an iPod/iOS device. It will attempt to use matching track IDs where they exist, but if they can't be found a second pass with attempt to index the library and find a track with matching properties (Artist, Album, Disc#, Track#, Name) and apply the stats to that if found.
tt2