Apr 23, '03 09:01:00AM • Contributed by: david-bo
For me, the Apple way of organizing my music is not flexible enough. In my music folder, I have a few subfolders, e.g., My albums, Demos, Bootlegs etc. The reason for this is that I want to apply different sharing restrictions on each directory. For example, the "My albums" folder everyone on the computer may read, the "Demo" folder is OK to share on Gnutella or DC, but no one but me must be allowed to listen to my bootlegs. The folders are organized like this:
Music My albums (below I will refer to this level as the root) Name of artist/composer Album name 01. Trackname.mp3 02. Trackname.mp3I handle compilations slightly different, I have a separate folder for them named Compilations:
Music My albums Compilation Album name 01. Artistname - Trackname.mp3 02. Artistname - Trackname.mp3In the compilations case, I do not think it makes sense to have a a lot of artist folders with only one track in them. I typically have a lot of compilations from independent record companies with a lot of bands that never released more than an occasional track or two.
The big questions now is how to migrate this setup and keep the play count. I found a way that worked to about the 95% level (see caveats at the end about the missing 5%). Read the rest of the hint for all the details on how I accomplished this...
First one has to be aware of how iTunes traces the tracks in its library. By experimenting a little, I found that first it looks for inodes and as fallback if the inode is not availble, it looks for the file's path. I don't know if there are any further fallbacks.
Secondly, one also has to be aware of what iTunes does when it consolidates the library: when consolidating the library, iTunes looks at the ID3 tags of all tracks in its library it can find, and creates a hierarchy like this:
Music Name of artist/composer Album name 01. Trackname.mp3 02. Trackname.mp3 Unknown artist [for tracks without ID3-tags] Unknown album Trackname.mp3 Trackname.mp3Please note that the "My albums" level is removed. In addition, iTunes leaves the name of the tracks untouched. Simply consolidating the libary would, in my case, therefore have caused an unacceptable result, since the first level of separation ("My albums," "Demos," "Bootlegs" and a few more) would have disappeared.
The solution was to consolidate one root level ("My albums") folder at a time. However, it was not that easy. I realized this after my first attempt, when I simply moved the other root level folders to another location on the same partition. iTunes still kept track of the files in these folders, due to their inodes, and therefore, consolidated them toghether with the "My albums" folders.
To force iTunes to temporarily forget about the files in the other root folders, I had to duplicate them, and delete the original folder. Now I had something that looked like this:
Music My albums Demos (copy) Bootlegs (copy)Consolidating now leads to only the "My albums" folder being consolidated. Obviously, you have to re-create the hierarchy on the receiving computer and volume. That is, when you changed the path to the iTunes library, you cannot change to "/Another volume/Music" when you consolidate the "My albums" root folder. Rather, you have to point it to "/Another volume/Music/My albums."
After consolidating "My albums," I duplicated this directory on the original volume and deleted the the original folder to be sure that the inode number changed. You should not need to do this, but I was so annoyed after working with this for a week so I felt "better safe than sorry." However, what you need to do is duplicate the "My albums" folder and then delete the original folder in its new location to break the inode connection. The folder hierarchy must look something like this after consolidating the "My albums" folder and preparing to consolidate the "Demos" folder:
[old location] Music My albums (copy) [the probably not necessary step] Demos [rename it back to its original name so iTunes' paths works] Bootlegs (copy) [new location] Music My albums (copy) [to break the inodes] Demos [an empty folder to which you point iTunes library prefs]Now iTunes finds everything in the "Demos" folder and has lost track of the "My albums" folder (both on the original and the new location). iTunes also has lost track of the "Bootlegs" folder in the original location. To distill this process:
- Duplicate all root level folders in your original location (to break inodes). Rename the one you will consolidate back to its original name (to make iTunes 'soft links' to its files work).
- Create a folder in your Music folder on the new location with the same name as the folder you are consolidating (i.e. My albums)
- Change iTunes prefs to point to the folder you created in step 2.
- Consolidate library. If this was the last root folder you want to consolidate, break here and go to step 8.
- Duplicate the consolidated folders, both on the original and new location (to break inodes). Delete original folders.
- On the original location, rename the next folder you will consolidate to its original name (by removing " (copy)" at the end of the folder's name; this enables the soft links).
- Repeat from step 2 with all folders.
- You now have a hierarchy like this on the new location:
Music My albums (copy) Demos (copy) Bootlegs
- Quit iTunes and remove " (copy)" from all folders names.
Caveats:
- My compilation directory was destroyed; now I have a lot of folders with only one or two songs in them. I would appreciate suggestions on how to fix this.
- I think this method is a PITA; really, there should be an easier way. Basically you only need to change the prefix in the search path in iTunes' library, something like replacing the string "/Volumes/Old location/Music/" with "/Volumes/New location/Music/" on every entry in the iTunes track database
