Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Consolidate "iTunes Library" & "iTunes Music" folders on disk

Hi - I have my iTunes folders/library stored on in a shared folder on a NAS, which has been operating for about 2 years.


In December 2010, the library structure changed from having "iTunes/iTunes Library/" be the primary storage location to having "iTunes/iTunes Library/iTunes Music/" be the primary location and now I have music and album art stored in both folders. I would like to clean this up safely without deleting the 'active' content, the issue is I don't know which folders are being used by the iTunes Library file.


The folder structure is:


iTunes/iTunes Library/ -> contains library files and was original location of music folders

- this 'iTunes Library' folder now has an "AlbumArt" folder that has not been modified since 9/09 and many (360) folders with music and album art files, many have been modified recently, so I assume they are "active" in the iTunes library file


iTunes/iTunes Library/iTunes Music -> created in 12/10, also contains music and album art folders that are "active" in the iTunes Library file, some folders are duplicates and others are not. I'm not sure if there are folders in "iTunes Library" that are not in "iTunes Library/iTunes Music".


I would like to have all the folders with music and art in the same location, presumably "iTunes Library/iTunes Music".


Thanks for reading and for any assistance - John

Windows 7

Posted on May 14, 2011 8:26 AM

Reply
Question marked as Best reply

Posted on May 14, 2011 11:25 AM

Here are the typical layouts for the iTunes folders:


User uploaded file


In the layout above, with the media folder (everything in the red box) inside the library folder, the library is considered to be portable. That is it can be moved to a new location or drive without breaking the links between the database and the media.


The basic non-fatal manipulations are:

  1. You can connect to an alternate set of library files by holding down Shift (Win) or Option (Mac) when starting iTunes.
  2. You can move the library files to a new location (then connect as above) as long as the media stays put.
  3. You can move the library files and the media together if the media folder is a direct subfolder of the library folder.
  4. If you have already moved/copied the media content from a subfolder of the library folder to a different location then you only need to copy the library files for it to appear as if you have moved the entire library in the way allowed above. I.e. just copy the library files into the parent folder of the media folder.
  5. You can rename the media folder to iTunes Media (if it isn't already) if the media folder is inside the library folder.
  6. iTunes uses the name of the folder holding the library files as the window title. Having made a library "portable" you may need to take a final step of renaming the library folder to iTunes or, if the library files have ended up at the root of a drive, moving all of the library files and content folders into a new folder called iTunes.


After each change you need to open, test and close the relevant library before attempting another change. If a change broke the library, undo it or revert to using the previous set of library files.


Before you start any media files that are outside of the media folder should probably be consolidated, particularly if you want to end up with a fully portable library. If the library is in the old style layout then it should be upgraded to iTunes Media Organization (Library > Organize Library > Rearrange files in the folder <Media Folder>) to ensure that iPod Games, Mobile Applications etc. are brought inside the media folder otherwise certain manipulations may mean that these items will need subsequent relinking to the library.



So, with that general background covered let's see if we can't make some concrete suggestions just for you.


I'd suggest you start by making sure iTunes is using the new iTunes Media Organisation layout, except they've stopped using that description. You'll find an option under File > Library > Organize Library... Reorganise files in the folder "<Media folder name>". Catchy huh? Tick the box if it will let you, then click OK.


Now identify the active iTunes Library.itl file. From what you've said this should be the one at \iTunes\iTunes Library\iTunes Library.itl which should have today's modification date if you've accessed it. If in doubt use my script iTunesXMLPath to determine the active library folder.


Assuming they are not already there, and with iTunes closed, copy the active library files iTunes Library.itl, iTunes Library Extras.itdb, iTunes Library Genius.itdb, sentinel and the folder Album Artwork to the folder \iTunes. Ignore the .xml file as iTunes will rebuild it automatically. If there are existing versions of the files or the Album Artwork folder inside \iTunes move these to some temporary location to await final destruction.


Now click the icon to start iTunes and immediately press down and continue to hold the SHIFT key until asked to choose or create a library. Click choose and navigate to the file \iTunes\iTunes Library.itl. Check that all is still well with the library and that media can play.


Use Edit > Preferences > Advanced to change the media folder location to \iTunes\iTunes Library. After changing the location iTunes may go though an "Updating your library phase", don't interupt this.


Now use Edit > Preferences > Advanced and uncheck the option to Keep iTunes Media Folder organized, apply the change, then go back and turn the option on again. iTunes should reogranize all your media correctly in the \iTunes\iTunes Library folder.


Close iTunes, rename iTunes\iTunes Library as \iTunes\iTunes Media. Start iTunes again. Check under Edit > Preferences > Advanced that the media folder location has been updated to \iTunes\iTunes Media, correct if not.


At this point you should move any older copies of the library files and album artwork folder to a safe place for later deletion.


It is also possible that there are files in your folder structure that aren't connected to iTunes. I'd suggest you get a copy of iTunes Folder Watch, then scan your folders with it and add any new files that it finds. You may need to dedupe later in which case you want to delete the copies added to the library today.


After all the moving about you might have some redundant folders. I have a script for cleaning up called CleanDeadArt which should help with that.


I think I've covered everything, but it's much easier to do than describe. Take things slowly and check before moving on.


tt2

7 replies
Question marked as Best reply

May 14, 2011 11:25 AM in response to john_austin

Here are the typical layouts for the iTunes folders:


User uploaded file


In the layout above, with the media folder (everything in the red box) inside the library folder, the library is considered to be portable. That is it can be moved to a new location or drive without breaking the links between the database and the media.


The basic non-fatal manipulations are:

  1. You can connect to an alternate set of library files by holding down Shift (Win) or Option (Mac) when starting iTunes.
  2. You can move the library files to a new location (then connect as above) as long as the media stays put.
  3. You can move the library files and the media together if the media folder is a direct subfolder of the library folder.
  4. If you have already moved/copied the media content from a subfolder of the library folder to a different location then you only need to copy the library files for it to appear as if you have moved the entire library in the way allowed above. I.e. just copy the library files into the parent folder of the media folder.
  5. You can rename the media folder to iTunes Media (if it isn't already) if the media folder is inside the library folder.
  6. iTunes uses the name of the folder holding the library files as the window title. Having made a library "portable" you may need to take a final step of renaming the library folder to iTunes or, if the library files have ended up at the root of a drive, moving all of the library files and content folders into a new folder called iTunes.


After each change you need to open, test and close the relevant library before attempting another change. If a change broke the library, undo it or revert to using the previous set of library files.


Before you start any media files that are outside of the media folder should probably be consolidated, particularly if you want to end up with a fully portable library. If the library is in the old style layout then it should be upgraded to iTunes Media Organization (Library > Organize Library > Rearrange files in the folder <Media Folder>) to ensure that iPod Games, Mobile Applications etc. are brought inside the media folder otherwise certain manipulations may mean that these items will need subsequent relinking to the library.



So, with that general background covered let's see if we can't make some concrete suggestions just for you.


I'd suggest you start by making sure iTunes is using the new iTunes Media Organisation layout, except they've stopped using that description. You'll find an option under File > Library > Organize Library... Reorganise files in the folder "<Media folder name>". Catchy huh? Tick the box if it will let you, then click OK.


Now identify the active iTunes Library.itl file. From what you've said this should be the one at \iTunes\iTunes Library\iTunes Library.itl which should have today's modification date if you've accessed it. If in doubt use my script iTunesXMLPath to determine the active library folder.


Assuming they are not already there, and with iTunes closed, copy the active library files iTunes Library.itl, iTunes Library Extras.itdb, iTunes Library Genius.itdb, sentinel and the folder Album Artwork to the folder \iTunes. Ignore the .xml file as iTunes will rebuild it automatically. If there are existing versions of the files or the Album Artwork folder inside \iTunes move these to some temporary location to await final destruction.


Now click the icon to start iTunes and immediately press down and continue to hold the SHIFT key until asked to choose or create a library. Click choose and navigate to the file \iTunes\iTunes Library.itl. Check that all is still well with the library and that media can play.


Use Edit > Preferences > Advanced to change the media folder location to \iTunes\iTunes Library. After changing the location iTunes may go though an "Updating your library phase", don't interupt this.


Now use Edit > Preferences > Advanced and uncheck the option to Keep iTunes Media Folder organized, apply the change, then go back and turn the option on again. iTunes should reogranize all your media correctly in the \iTunes\iTunes Library folder.


Close iTunes, rename iTunes\iTunes Library as \iTunes\iTunes Media. Start iTunes again. Check under Edit > Preferences > Advanced that the media folder location has been updated to \iTunes\iTunes Media, correct if not.


At this point you should move any older copies of the library files and album artwork folder to a safe place for later deletion.


It is also possible that there are files in your folder structure that aren't connected to iTunes. I'd suggest you get a copy of iTunes Folder Watch, then scan your folders with it and add any new files that it finds. You may need to dedupe later in which case you want to delete the copies added to the library today.


After all the moving about you might have some redundant folders. I have a script for cleaning up called CleanDeadArt which should help with that.


I think I've covered everything, but it's much easier to do than describe. Take things slowly and check before moving on.


tt2

May 14, 2011 1:17 PM in response to turingtest2

Thanks for the detailed response!


My folder structure is some strange hybrid:


iTunes

iTunes Library <- library files here

Artist 1

.....

Album Artwork (not used?)

Automatically Add to iTunes

iTunes Music

Artist 1

.....

Automatically Add to iTunes

Music

Artist 1

.....


Also, my album artwork is in all 3 "Artist 1" folders.


So, I will follow your instructions and report back! Thanks again - John



Updates:

1) The "File > Library > Organize Library > Reorganize files in the folder "Folder" option is greyed out and not available. Will skip this step.


2) Could you explain "If there are existing versions of the files or the Album Artwork folder inside \iTunes move these to some temporary location to await final destruction."?

- By "files" do you mean the library files? (I only have one set).

- And the only "Album Artwork" folder is in "iTunes/iTunesLibrary", individual album folders have jpgs stored in those folders.

May 14, 2011 2:28 PM in response to john_austin

Ok, so I ran through the process and it definitely has helped. However, my folder structure is still significantly different from your "iTunes 9 & later" example (I am on 10.1.1.4).


My new structure is:


iTunes <- library files here

Album Artwork (moved from "iTunes Library")

iTunes Media (previously "iTunes Library")

Album Artwork (empty, so I deleted)

Artist 1

Artist 2

...

iTunes Music (left over - deleted)

Mobile Apps (111 items)

[Music] - this was not created by the process

Mobile Applications (new)


I am going to check the "Reorganize files in the folder.." option, which is now available.


Thanks - John

May 16, 2011 9:07 AM in response to turingtest2

tt2,


Just to clarify, if I make everything portable on an external drive, with the library file in contained in the iTunes folder, does the specific drive letter designation matter if I use shift-open or can I open the library no matter where I take the external drive regardless of what drive designation that drive is given on the different computer?

May 16, 2011 9:48 AM in response to vaevictis

That's the point, now the library is in this portable format you can clone the iTunes folder to another disk with another drive letter (i.e. make a backup!) and you can test that backup with the shift-open- iTunes method. Works equally well with a different drive letter or a UNC path. For a suitable tool for the backup job try SyncToy 2.1.


In fact, with a larger library you may get some perfomance benefit from having the library files on an internal drive. In that case they can be copied to an internal drive, used there, and then copied back to the external before any changes in drive letter/path are made.


BTW any Folder.jpg images (and the interestingly named copies thereof) in your original folder structure were created by Windows Media Player and are ignored by iTunes, hence the need for a clean up tool after iTunes has reorganised things.


tt2

Aug 21, 2011 6:20 PM in response to turingtest2

turningtest2, you seem to really know your stuff!


I've read through your answer, but I think my situation is a bit different to the one here... and I wouldn't wanna mess up iTunes. I've made a detailed post asking about what the best way to proceed would be.


Perhaps you would be as so kind to take a look:


https://discussions.apple.com/thread/3278989


Thank you!

Consolidate "iTunes Library" & "iTunes Music" folders on disk

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.