Change itunes local music file path location iTunes?

I cut and pasted my entire local music file directory(s) on the hard drive (Windows 7) to a new location on the same hard drive. These are all my songs and not on or from iTunes. Naturally, all music files listed in local iTunes now display '!' as no longer linked.


As opposed to a mass delete in iTunes and then a mass relink of all the music files with the consequent manual regeneration of playlists, is there a way that iTunes can be told to do this automatically if given the correct new file path that I have not been able to discover?


Mark

iPod nano, Windows 7

Posted on Oct 20, 2012 8:08 AM

Reply
15 replies

Feb 14, 2014 6:49 PM in response to Markg2

This is not needed any more complex things and scripts. Now in Itunes 11 its simple! you just search the file path for 2 or 3 songs of different folders in your new location within Itunes where the " ! " sign appears. Close the application, open it again, give 3 or 10 minutes (depending on the amount of music you have) to Itunes to auto-re-determine new location and voilà! You are done.

Oct 20, 2012 8:33 AM in response to Allan Sampson

I cannot explain why other than I had never chosen to allow iTune to orngainize my library. However, I always added tunes to iTunes from my personal, not iTunes related general local music directory.


Which was fine for me since based upon my prior queries here if I somehow corrected this condition and allowed itunes to create it's own library of my library then I'd end up with 2 sets of music libraries--a ton of unnecessary GB's.


So I presume given my added information that *this time I will need to manual recreate all.


Going forward, I would be interested in your input on the 2 points:

1. Does allowing iTunes to create its library of my library create duplicates of all tunes or just links between files on my drive?

2. Why do you think support initially suggested against letting iTunes organize?


Mark

Oct 24, 2012 6:09 AM in response to Markg2

The general method of use is to download the script to a folder of your choice, e.g. your Desktop, Downloads folder or create a folder at ...\iTunes\Scripts. Select a playlist or highlight some tracks in iTunes and then double-click on the script to execute it. If no specific tracks are selected the script will try to work with all tracks in the current playlist. If the script doesn't run as expected you may need to enable the Windows Script Host.


You are strongly advised to backup your entire library, or at the very least the iTunes Library.itl file, before use. Test the behaviour of your chosen script on a small group of files first to make sure it does what you want before applying it to large numbers of files.


tt2

Feb 1, 2014 9:17 AM in response to Markg2

Hi Guys,


I dont know if this is still a problem, but I will tell you what I did. I wanted to simply change the name of the music folder I use to store my music. I do not store all my music in itunes as my music started with a Zune player and I like having it organized my way, not iTunes way. Anyway, I wanted to make a simple rename of the folder from MP3 (started this folder 16 years ago) to Music. of course it broke all the links and couldnt find the music. So what I did was:


1) made a copy of the iTunes Music Library.xml file

2) renamed the music folder from MP3 to Music

3) opened the copy of iTunes Music Library.xml file using wordpad or the like

4) did a search and replace for the previous path with the new path (for me I just used /Music/MP3 and replaced with /Music/Music)

5) I then renamed the previous iTunes Music Library.xml file to something else and removed the "copy" out of the name of the iTunes Music Folder I just changed so it would read this new file

6) Reopened iTunes and changed the music folder location in the preferences-advanced to the new folder name. I have the "Keep Itunes media folder organized" checked, and when it asked me if I wanted Itunes to keep it organized (or some crap), I selected yes.


When I finished, it now knew where all the songs were located and when I checked the info it points to the new location. I imagine this could be used for any transfer of folder location or name by just searching and replacing with the correct location or name.


This seemed to work for me, so if it is something that you can use, then enjoy.


Regards,


Ray

Aug 20, 2014 9:57 AM in response to Markg2

Hi there.

I'm also thinking of moving all my music to a new hard drive.

Right now the music files are located on two different drives, and my iTunes folder is on C:\Users\Echoes\Music\iTunes\iTunes Music

Before I end up consolidating my collection I'd like to try another approach, in which the iTunes folder will not change.


- So I have copied all my music to the new hard drive (so now all files will be located in one dedicated HDD)

- Then I'm thinking of taking a backup of everything related to iTunes (the whole iTunes folder)

- My previous two hard drives will still be there with my music in case something does not work with this new approach

- Then I'm thinking of deleting everything from the MUSIC library of iTunes as well as the Playlists I have, after I back them up one by one. The deletion will be done from within iTunes by choosing all songs and deleting them.... (?)

- Then go to iTunes and "Add folder to Library" and add all my new folders of music files

- Then Edit my playlists (with notepad or notepad ++) and search and replace the paths with the new ones

- Then import these playlists to iTunes.


Could someone tell me if the above has any chances to work fine ?

Thank you in advance.

Aug 20, 2014 10:28 AM in response to IoannisGR

Frankly I'd go back to my advice of March 8th: Re: Regarding Consolidation & Recreation of my library...


This will leave your original library completely untouched while making sure that the new copy of it is in a suitable shape for backup and future moves. In essence you need to create one or two folders, copy four files, shift-start iTunes to switch libraries and then let iTunes do all the hard work. All of the playlists in iTunes will be preserved.


For more background see Make a split library portable.


tt2

Jul 3, 2015 7:39 PM in response to raysinred

For anyone doing this on a Mac or Unix / Linux machine with standard command line utilities installed (mainly: sed or perl), you can use a simple find & replace command rather than a text editor (otherwise, the process is very similar to @raysinred's instructions, and you can in fact follow those instructions instead!) The following instructions are especially helpful if you did not choose to let iTunes manage your music files, and you store them in your own location and simply want to move them to another drive or location.


First, read this official Apple Help article: iTunes: How to re-create your iTunes library and playlists - Apple Support


We are going to first run a command to find & replace the old file Location with the new file Location for every Track in "~/Music/iTunes/iTunes Music Library.xml". Then, we will follow the instructions for recreating the Apple iTunes Library by using "iTunes Music Library.xml".


  1. Locate your "iTunes Music Library.xml" file (See help article for locations)
  2. Open the .xml file in a text editor or pager of your choice (I used "less" from the command line: less ~/Music/iTunes/iTunes\ Music\ Library.xml )
  3. Look for the string: <key>Location</key>
    You should see something like: <key>Location</key><string>file://localhost/<OLD_FILE_PATH_HERE>/foo/bar/baz.mp3 </string>
    Find the part of that string you want to replace (e.g.: <OLD_FILE_PATH_HERE>), and copy it for the next command
  4. Run the following find & replace command, and make sure your OLD and NEW file paths match the correct location:
    sed -i '' -e 's|<OLD_FILE_PATH_HERE>|<NEW_FILE_PATH_HERE>|' iTunes\ Music\ Library.xml
    For example:
    sed -i '' -e 's|C:/Users/JohnDoe/Music|Users/jdoe/Music|' iTunes\ Music\ Library.xml
    On a non-BSD unix variant, you may need to omit the single quotes after the "-i" parameter... For Example:
    sed -i -e 's|C:/Users/JohnDoe/Music|Users/jdoe/Music|' iTunes\ Music\ Library.xml
    (Note: for advanced users, you can do any fancier things you desire with Regular expressions (or even more advanced programatic things with perl: perl -p -i -e 's|<OLD_FILE_PATH_HERE>|<NEW_FILE_PATH_HERE>|; if ( $_ ~= /foo/ ) { ... do something ... } ;' iTunes\ Music\ Library.xml)
  5. Follow the instructions at the Apple Help article after the heading: Re-creating the iTunes Library file
    Choose File > Library > Import Playlist
    Navigate to the "iTunes Library.xml" file
  • Mac users: Click Choose.
  • Windows users: Click Open.


Hope this helps provide another alternative solution to the problem for anyone wanting more advanced find / replace behavior.

May 28, 2016 9:22 PM in response to Malignance

Just find yourself 1 song manually. After that Itunes will tell you if you want to look for the rest of the missing songs in the same folder. Press Yes and itunes will automatically look for the songs. If you have all or most of the songs in the same folder your problem is solved. It happend to me when I moved my library from my old computer to my new one and all my songs had the ! and said not found. I have more than 800 songs so I was not going to look manually for them. After trying multiple options and not getting any results I started the process manually. Right after finding the first song, itunes gave me the option of looking automatically for the remaining missing songs in that same location. Most of my songs where on the same folder, so Itunes automatically found around 650 songs. Luckily, I didn't have to look for the 800 songs.

PS: I know your comment is old and you already fixed your problem. But it may help someone else who has the problem now.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Change itunes local music file path location iTunes?

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