You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Make a split library portable

Last modified: Dec 11, 2020 7:32 AM
57 129210 Last modified Dec 11, 2020 7:32 AM

The aim of this tip is help you get a split library into a portable form, or convince you not to split up the library in the first place.


A "split" iTunes library is one where the active library file is stored in one place, typically the iTunes folder inside your user's Music folder, while the content has been stored somewhere else like an external drive. Once a library has been split like this it becomes harder to move the library to a new path or computer without breaking the connection between the library and the media files. There are also unwanted side effects with a split library if iTunes is ever started up while the drive holding the media folder is offline, or Windows assigns that drive a different drive letter for some reason. iTunes will silently reset its media folder to the default path, a folder called iTunes Media in the library folder, and won't be able to access your media until you connect the drive and restart iTunes. iTunes will continue to use the default media folder for all new content until you change the location again via preferences, and then you need to remember to consolidate the media that is stored in the wrong location, and clean up any originals left in the wrong place.


Split libraries are usually created when a user runs out out room on the source drive and reads advice to move their media to a new media folder on an external drive. Rather than splitting the library seasoned iTunes users will move the entire working library to a new location and then connect to it there. When a library has been relocated in this fashion if you should start iTunes with the host drive offline, iTunes will complain that it can't find the library and ask you to choose or create one. At this point you can cancel, connect the drive and then start iTunes as normal. No preferences will have been changed.


A "portable" library can be moved from one path or computer to another without breaking the links between the library and the media, and being self-contained is much easier to backup. You can even move a portable library between Mac and Windows machines. If you backup a portable library by cloning the library folder to another drive then, should the source copy fail, you can start using the library on the backup device immediately.




Make a split library portable

Here are the typical layouts for the iTunes folders:


User uploaded file



In the layout above right, with the media folder (everything in the red box) directly inside the library folder, in the "new" layout, and with all media consolidated (i.e. there are no items stored outside of the media folder), the library is considered to be portable. The principle difference between the new layout, once referred to as "iTunes Media Organization", and the old one is that iPod Games, Mobile Applications and Ringtones have been moved inside the media folder instead of being in the library folder, and artist folders have been moved down a level into <Media Folder>\Music. More recently Ringtones was renamed as Tones. There may also be regional differences.




You can rearrange things to make a split library portable by taking a number of small steps which don't break the library. Backup the current state of the library, or at the very least, the iTunes Library.itl file, before you start. See Backup your iTunes for Windows library with SyncToy for a suggested strategy (Windows only, but similar tools exist for OS X). In each case only a subset of these operations are likely to be required. Which depends on the starting conditions.


The basic non-fatal manipulations of an iTunes library are:

  1. You can move the library files and the media together as a unit if the media folder is a direct subfolder of the library folder, the library is in the "new" layout, and if all media is consolidated, i.e. is in the desired portable layout. Connect to the library in the new location with step d.
  2. You can switch the library from the old layout to the new one using File > Library > Organize Library... > Rearrange files in the folder "<Media Folder>". This option is not available if the library is already in the new layout.
  3. You can consolidate any media stored outside of the media folder using File > Library > Organize Library... > Consolidate files. This option may be available even if all media is already consolidated. Use it if you are not certain.
  4. You can connect to an alternate set of library files by holding down Shift (Win) or Option (Mac) when starting iTunes then using the option to choose a library. If you don't get a prompt to choose or create a library close iTunes and try again holding the key down until the prompt appears. In some cases having chosen an alternate set of library files will automatically change the path to the media folder. This is what we want in a "portable" library but if it happens when it isn't wanted you can reset the media folder to the correct path which should repair any broken links in the library.
  5. You can copy or move the library files (the 5 files listed at the bottom of the image above together with the Album Artwork and Previous iTunes Libraries folders) to a new location, then connect to them there with d. as long as the media stays put.
  6. If you have already copied or moved the media content from a subfolder of the library folder to a different location (via consolidation or manually, thereby breaking your library) 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 in a. I.e. just copy the library files into the parent folder of the media folder.
  7. You can rename the media folder to iTunes Media (if it isn't already) if the media folder is directly inside the library folder. Close iTunes, rename the folder, start iTunes. iTunes should update the media folder location accordingly.
  8. 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 down into a new folder called iTunes and then reconnecting to the library there with d.


After each change you need to open, test and close the relevant library before attempting another change. If a change broke the library, undo what you actually did or revert to using the previous set of library files. Make sure the correct media folder is being referenced.


Exactly which steps need to be used will depend on the starting arrangements of the library and the media. In many cases two or three will suffice.


When moving the library files from the default location to any other (in steps a. e. or f.) you can either correct the name of the .xml file or simply discard it. iTunes will automatically create the correctly named version of the file when it starts.


The steps above would normally be applied to a working library with no broken links (exclamation marks in the library) however step f. should repair a library if the media folder has been moved independently using Windows Explorer or Finder, after which steps g. and/or h. can be used if needed to apply the correct folder names.


Summary

In essence all you need to do to make a split library portable is copy the library files into the parent folder of the media folder on the external/secondary drive and use the hold-down-shift/option-when-starting-iTunes method to connect to it. Other manipulations may be required to normalize the library so that the library and media folders have standard names and the library is set out in the correct layout.



Network Performance

A library located on a shared network folder, NAS etc. may suffer from poor performance as each action in iTunes causes the .itl and .xml files to be updated. Should this be an issue then it is best to keep the overall structure of the portable library in place but copy the library files, Album Artwork and Previous iTunes Libraries folders back into a locally stored iTunes folder and connect to them there (e.). Before moving the library to a new drive or computer make it portable again by copying the library files back to the relevant folder on the network location (e. again) and accessing the library from that path at least once.



Manually Organized Libraries

Apart from steps b.and c. the operations can be applied to a manually organized library provided you already arrange your media inside the designated media folder while having the "Keep iTunes Media folder organized" option turned off. If you have kept your media outside of the iTunes Media folder until now you can assign the folder where it is stored as the media folder in iTunes preferences (Edit > Preferences > Advanced), and then proceed with moving the library files into the correct relative location.



iTunes media folder preference

It should be noted that changing the media folder preference in iTunes tells iTunes where to put new content that is added to the active library. It does not change which library database file is opened, nor will it make iTunes discover uncatalogued media or reconnect to media that iTunes cannot locate.



Opening the library on a different computer

Normally your portable library will open happily on the new computer, however in some cases iTunes may not be able to open the library for read/write access. In such cases see Repair security permissions for iTunes for Windows. Similar procedures exist for OS X. When moving between operating systems you find it easier to copy the library over a network. Windows libraries will generally be stored on NTFS drives which OS X can at least read, but since it cannot write to the drive the library would need to be copied to a Mac volume before it can be opened. Libraries created on OS X will normally be on an HFS+ formatted drive which Windows doesn't natively read or write. In either case it is possible to purchase write drivers for the other format, but it is an added complication to be aware of.




##

Relocate iOS device backups
On computers with SSD system drives any iOS device backups can take up a significant proportion of the available space. iTunes doesn't provide a mechanism for choosing where this backup data is stored, but it can be relocated onto another locally connected drive and a symbolic link or junction put in place so that it appears to iTunes as if the data hasn't moved.


This set of steps would place the data at D:\MobileSync\Backupbut the path could be adjusted to suit. Close iTunes while you do this.


  1. Make a new folder called MobileSync at the root of the drive you want the backup data to live on, e.g. as D:\MobileSync.

  2. Use Windows Explorer to move the current Backup folder at <SystemDrive>\Users\<User>\AppData\Roaming\Apple Computer\MobileSync\Backup into the folder you just made, e.g. using Ctrl+X to cut from the current location and then Ctrl+V to paste into the new one. If the backup folder is large this may take some time.
  3. To make iTunes look for the data in the new location copy the text below, open a command prompt, right-click to paste in the command, edit the destination drive letter/path if needed, and then press <Enter>.


    MkLink /J "%AppData%\Apple Computer\MobileSync\Backup" "D:\MobileSync\Backup"


    If you've installed iTunes from the Microsoft Store use this command instead.


    MkLink /J "%UserProfile%\Apple\MobileSync\Backup" "D:\MobileSync\Backup"



It is possible to do something similar with OS X, but in that case it is ~/Library/Application Support/MobileSync/Backup that needs to be moved and then redirected. The redirection command in Terminal looks like this:


ln -s "/Volumes/<New Volume>/MobileSync/Backup" "/Users/<User>/Library/Application Support/MobileSync"


Where <New Volume> is the name of the volume you want to store the data on, and <User> is the name of your profile. If there are spaces in the path wrap with quotes or escape with backslash. It is probably easier to type in ln -s then drag and drop the two folders onto the command line in turn.


Note that while this method works for iOS device backups it cannot be used to redirect subfolders of the iTunes Media folder.


^ Top




Related support documents

HT204668: Locate and organize your iTunes media files

HT201596: Open a different iTunes Library file or create a new one

HT201610: About iTunes library files

HT201979: iTunes: Understanding iTunes Media Organization (Document retired, archive version)

Comments

May 1, 2019 10:37 AM

Please note the list of valid actions you can take with the library were originally labelled a. to h. and while referred to that way in the main text the list itself is now shown as 1. to 8. This is due to a change in the forum software and I am unable to edit the user tip to try to correct it without losing even more of the formatting.


tt2

May 1, 2019 10:37 AM

Dec 11, 2020 7:32 AM

Apple Music in macOS 10.15 Catalina and later


The same basic principles given above apply with Apple Music, however here the default path for the library folder is ~/Music/Music where ~ is the user's home folder, the library files are the package Music Library.musiclibrary inside ~/Music/Music and the media folder is ~/Music/Music/Media. Following an upgrade to Catalina or Big Sur from an older version of macOS the library may well be in a split configuration using the new path for the library folder and the old path for the iTunes Media folder as the media folder.


In most cases the simplest way to move the library to an external drive will be to copy ~/Music/Music/Music Library.musiclibrary into an empty Music folder created in the root of the external drive, use the option-start-Music method to access this new copy of the library, use Music > Preferences > File > Reset to reset the media folder to <External>/Music/Media and then use File > Library > Organize Library... > Consolidate Files to copy in the media. After the library has been tested, and ideally backed up to another drive, the original media folder can be removed.


tt2

Dec 11, 2020 7:32 AM

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