1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to Set Up an iTunes Library on a Network Attached Storage Device (NAS)

Discussion in 'General iTunes Usage' started by kirk, Oct 27, 2015.

  1. kirk

    kirk Administrator Staff Member

  2. Alexandre

    Alexandre New Member

    Hello Kirk,
    Thank you for the excellent article. I now plan on moving my entire iTunes folder to a Synology DS414 in order to free up some much needed space (1TB!) since I will be upgrading to an all-laptop environment.
    Two questions:
    Are there advantages in using a WD MyCloud over a Synology NAS? Ease of use? File system?
    Will using iTunes this way be the same as having the files locally, albeit slower? For example, will my AppleTV still be able to access movies and TV shows as it does now?
    Many thanks,
  3. kirk

    kirk Administrator Staff Member

    I haven't used Synology in a long time, but I would assume the software is similar these days. Essentially, it's the same as if the files are local. Just make sure that the NAS is mounted before iTunes launches.
  4. Alexandre

    Alexandre New Member

    And if the NAS isn't mounted and my media isn't available, I can live with that. I just don't want iTunes to revert its settings to my local drive... I'd like to avoid the "it gets messy" part in your article!
  5. kirk

    kirk Administrator Staff Member

    But that's what happens if the NAS isn't mounted; iTunes can't find it, so it reverts. So, no, you can't really live with that, unless you check iTunes' Advanced prefs at every launch to make sure it's looking in the correct location.
  6. Alexandre

    Alexandre New Member

    OK. Did I miss or misunderstand something then when you write:

    Move your entire iTunes folder
    This is a simpler process. Just copy the iTunes folder in your home folder’s Music folder to the NAS. As above, this may take a long time.
    The first time you launch iTunes after the move has completed, press the Option key immediately after clicking the iTunes icon. Click Choose Library, and then navigate to the iTunes folder on the NAS. iTunes will then use this library, and, if it’s not available on the network, will alert you. It won’t revert its settings to your local drive.

    Sorry to insist on this issue, but with various people in our household accessing iTunes, I'd like to avoid a mess…

  7. kirk

    kirk Administrator Staff Member

    Yes, there are two ways to do it. I tend to prefer not copying the library files (which is what happens when you do the above). But if you do it, then you are protected from iTunes reverting the media folder location.

    However, make sure you don't have two people trying to access it at the same time. And it's a good idea to back up the library files often (that's the main reason I don't think it's a good idea; it's harder to back those files up.)
  8. Iololike

    Iololike New Member

    Last edited: Jan 22, 2017
  9. UKenGB

    UKenGB Member

    Make an alias to the actual Media folder in its shared network location and place that in iTunes default location with the default name. If iTunes launches and cannot immediately find the media files because the share hasn't been mounted, it will try to revert to the default, but find the alias and follow where that points which I think will in fact mount the necessary volume.

    I'm pretty sure that's how I used to do it, but it's some years ago now and Apple may well have found a way to ensure that no longer works as they seem to have a habit of making life difficult for users.
  10. UKenGB

    UKenGB Member

    One of the features of such a configuration is that multiple users can then share the same media files by all pointing iTunes to the network shared storage. But I've been wondering about something.

    Whichever of the 2 paths proposed by Kirk that you undertake, i.e. either the entire iTunes folder or just the Media folder is on the share, it WILL share the 'Automatically Add to iTunes' folder. This is of course being monitored by iTunes for any new files and it promptly grabs and imports them. But when this folder is actually being simultaneously shared, potentially by several clients, which one gets the new files?

    Maybe iTunes is clever and ceases to monitor the folder if it is located on a potentially shared network location. Otherwise is it just a lottery as to which instance of iTunes gets each added file or what?

    The obvious solution would be to locate that folder in the iTunes folder, above the Media folder and share the Media folder but keep the rest local (a better solution anyway IMO), but typically, there is no control over the location of any of iTunes folders, apart from either of the 2 aforementioned options and both of those give rise to this issue about the 'Automatically Add to iTunes' folder.

    Anyone know the answer to this. What happens when that folder is actually shared between more than one running instance of iTunes?
  11. kirk

    kirk Administrator Staff Member

    I wouldn't count on that always working with network volumes.
  12. kirk

    kirk Administrator Staff Member

    You're thinking that you can share it with aliases, or with symlinks? I'm not sure that's a Good Idea. I can imagine only Bad Things happening.

    Now, you say that multiple users can share the same media. This is true, and this is quite simple, but it's file sharing, not iTunes library sharing. You'll be able to access the media files on different computers, but each user will be responsible for adding them to their libraries. And if you do so via the Automatically Add to iTunes folder, I think that could mess things up, potentially moving them to where other users wouldn't be able to use them. And, of course, no user can change any tags, because that will screw up other iTunes libraries.

    There's no safe workaround to having multiple users share the same media files. The best way is to create a master library and use Home Sharing.
  13. UKenGB

    UKenGB Member

    If the entire iTunes folder is placed in the shared location (e.g. NAS), that means the AAtiT folder is being shared and as you say, I can't imagine it playing nicely. But has anyone tried this? I don't want to actually do this, but was intrigued as to what would occur if you did. It could just be deleted, but doesn't iTunes then simply re-create it when starting?

    If you're not going to share the media content, why use a NAS? A big locally attached drive has to be easier and simpler.

    Yes I understand the difference between file sharing a iTunes sharing and Home Sharing is the best way for other users to access the content, agreed, far better than the original library sharing which didn't even provide album artwork, nor any ability to change any listing sort order as far as I can remember. But to have a single master library on a server means that I have to do everything on the server and that (currently) doesn't even have a CD/DVD device from which to rip new media. So I have to do that on my Mac (Pro) which is in any case how I want to control everything.

    The ideal is an impossibility with the current iTunes and Apple's way of thinking, so my plan is to use my Mac to do everything, but to replicate that onto the server as the master library for anyone else, TVs etc to share from. But the best way to keep my Mac and the server in sync is the tricky part. I cover it in more details in the other thread I started about iTunes server and sharing.
  14. UKenGB

    UKenGB Member

    Another quick question:-

    Can anyone suggest the best way to MOVE a complete iTunes library, i.e. just to a different location within the same file system?

    I know I can change the path to the Media folder in prefs and then Consolidate, but that always copies the files. This is stupid when it's a huge library and just needs moving to a different location within the same file system which would make it very quick as no files would actually be moved anywhere. Not only that, but there is no room on the disc to duplicate everything. Currently there's about 800 GB on a 1 TB HD so there's no way it can possibly be copied even if I were to wait all that unnecessary time.

    I can try to fudge it by fooling iTunes with aliases etc. but surely there must be a decent way to get iTunes to simply accept the new location, MOVE the files and update their location in the library file?
  15. kirk

    kirk Administrator Staff Member

    Re the Automatically Add to iTunes folder; this is most likely a sort of folder action, so macOS will funnel the files to the local library.

    Re the NAS: some people want to do this for libraries they manage on laptops. I agree; there's no point in using a NAS with a desktop computer. These days, I'd just use a self-powered USB3 drive. I have a few of them that hold 4 TB.

    As for the final point, as I said above, you can rip on one Mac, and add them to the library on the other Mac (or server). It's probably easier in the long run, since tagging locally is a lot simpler than via screen sharing.
  16. kirk

    kirk Administrator Staff Member

    I'd do this. Create the new target folder, and choose it in the iTunes preferences. Quit iTunes, move the files to the target folder, then launch iTunes. It should immediately find all the files. You might need to consolidate just in case afterwards. (I have done this in the past, and it has worked, but it's been quite a while, so I'm no exactly sure how iTunes would handle that now.)
  17. UKenGB

    UKenGB Member

    Yes I've done this in the past too, but some years ago and it's a big vague now, besides which iTunes may longer behave in the same way.

    Today I had an issue with some podcasts that iTunes had placed in the iTunes/Media/Downloads folder, maybe because I was sharing the Podcasts folder at the time and so it couldn't place them in that normal folder. Who knows. Anyway, I simply UNchecked 'Keep folder organised' in iTunes prefs and closed the prefs window. Opened again and checked that option and closed the window again. It then started running through all the files. At least it seemed that way as it took a while and filenames were flashing up in the small dialog at the usual unreadable rate. Certainly it was more than just the dozen or so podcasts that were out of place. When it had finished, the podcasts had been correctly placed. Maybe when checking that option it simply looks to see what needs moving and then does move rather that as Consolidate which copies.

    But I'm sure in the past it simply found the files in the new place. Does the library file store a reference to the file, so it would still know the files even if they've been moved? That's what I previously surmised.
  18. kirk

    kirk Administrator Staff Member

    I seem to recall a few years ago that something changed, that you could find one missing file, and iTunes would correct a lot of others. I haven't tested that in a while, but it's possible that updating the location of one file might propagate to others. You could probably test by manually moving a bunch of files, then finding one, then seeing what happens.
  19. UKenGB

    UKenGB Member

    Well after a bit of messing about, my local iTunes was happily using the content from its new location, without anything being copied, just moved and every file location in iTunes seems to be pointing at the correct folder and the new location of the media folder is specified in the prefs. So far, so good. I also have an exact copy of this Media folder on the server and which I now NFS shared (using the /etc/exports file). With iTunes off I renamed the local Media folder and created a new empty Media folder, onto which I mounted the share from the server. When iTunes started it simply accepted those shared files as they all have the same path and it will play any selected music or video. But all is not well.

    I can edit the name of a Home Video and the name of the file (on the server of course) is changed as you'd expect. But if I change the name of a music file, the filename is not updated, although the file IS. The actual tag data is updated as is the time stamp of the file, so the new track name IS being saved, but iTunes does not update the filename to suit. I changed a Music Video to a Home Video and it moved the file into the Home Videos Folder and any changes to the name means iTunes updates the tag and the filename. But If I change the type back to Music Video, iTunes edits the file, but does NOT move it back to the Music folder. It is now stuck in the Home Videos folder.

    So for some reason, the Home Videos folder works fine and any file in the Music folder can be updated, but iTunes cannot change the name of a music file, nor can it add a file into that folder.

    I've studied the permissions on the server and how they appear locally. All the folders are 775 and all the files are 664. Everything is owned and group 'jukebox' which is the name of the user on the server and also its main group of which I am also a member, all of which is identical on my local Mac and the server (same UIDs and GID to make sharing simpler, Ha). The only difference I can determine is that Music files reside 2 folder levels lower than Home Video files as Music files are under the Artist and Album folders whereas Home Video are not. But since all ownerships and permissions are identical, I cannot se why this should make a difference.

    It has occurred to me that this may be the same problem as when I individually shared and mounted the media folders I wanted to share. At first I didn't notice any problem, then assumed iTunes simply didn't like those media folders being network shares, but now I wonder if it is in fact the same problem when I share and mount the entire Media folder. In any case, can anyone suggest any possible reasons why iTunes is behaving like this? There must be many users sharing their Media folder on a NAS drive, does that work completely and correctly? In which case why is mine not doing so? Or are there always such problems, but because iTunes masks them, no-one has noticed?

    If you are sharing the Media folder across the network, can you edit the name of a music track and the file name changes to suit? If not, what about Home Videos?

    I have certainly shared iTunes' Media folder in the past, but not for some years and in the meantime there have been many revisions of iTunes. Perhaps later versions have this problem? Or can anyone spot the flaw in my setup?
  20. UKenGB

    UKenGB Member

    Done some more testing and iTunes seems to be very inconsistent. Home Videos, Movies, Podcasts and TV Shows all seem to work fine. I can update any metadata and the file is updated and the name changed as required. But AudioBooks and Music do not. The files seem to have their metadata (tags) updated, but the filename is never changed and new files of those types cannot be added. I can see no reason whatsoever why there should be this difference. Is it iTunes?

    In fact it has confused me even further. The server had some Movies stored and although the files are now available to my local iTunes, they're not yet in the library. So I tested one and then selected Add to Library from the whole folder. Which they were, but instead of each movie file in its own folder, all the movie files are now together in the Movies folder. This does make more sense to me as they don't need their own folder, but how come they were previously in their own folder, but now are not? Has iTunes changed and keeps whatever structure already existed, but given the chance it will simplify the Movies folder. I checked another Mac and iTunes is definitely keeping each movie file in its own folder. Is this simply a change in iTunes behaviour?

    I also saw something similar when I was moving the library. The first stage resulted in all media types using the Media folder instead of their own sub folder. So all Artists' folders were in the Media folder and there was no Music folder, even though the prefs were set to 'Keep Media Folder Organised'. So I then selected File/Organise Library and it whizzed away and put everything in the right media type sub folders. The point is the 'whizz'. Took only a few minutes (or less) to re-organise all 25,000 files (only had to move them after all).

    Anyway, back to the Movies folder structure and I thought to try 'Organise Library' again which might re-create the Movies folder as it has always been with a folder for each file. This process started to run, at about 2 seconds per file. I let it run for a while to see if it would speed up at all, which it didn't. Apple hadn't thought this through and there's no way to stop it. So rather than wait years for it to finish, I had to Force Quit iTunes. I restarted it and tried again, but the same excruciatingly slow progress and had to Force Quit again.

    So has anyone else found that iTunes now places movie files directly in the Movies folder? Also, has anyone any suggestions as to why a super speedy process earlier today will now only run like a snail?

    Actually, I've just thought. iTunes is now dealing with the files across the network, whereas this morning they were local. But this is a Gigabit network and stuff is mostly really fast and there's no reason why iTunes speed for this process would drop by a factor of hundreds, if not thousands. Any bright ideas?

Share This Page