Move external iTunes library files to different location without losing metadata

applescriptitunes

I'm trying to move my iTunes library to a new location. I'm running iTunes without the "organize media" option because I keep my library (60000+ songs) on a second drive in my MacBook… I recently upgraded to a new MacBook with a lot less storage but found out that you can run iTunes from a WebDAV cloud server without any noticeable lag (Yep!). I already have an exact copy of my second drive on the server but now I would like to know the simplest way to change the paths for all tracks in bulk? I've found some solutions myself but it would take literally weeks to complete:

  1. When playing a song that is not in its current position, iTunes will ask for the new location of this file and then will try to find other missing files in that same directory (so only that cd is imported). The importing itself is slow as well but that's probably due to the server.

  2. Doug created a script that can change the location of selected files without losing metadata/rating but 500+ albums would take a too long 🙁

I hope there is a simpler and faster way changing the paths since this is the last step holding me back from running my library from a cloud server.
For those interested, I can't store the library files on the cloud server as iTunes rewrite the library file (200mb) every time you change a rating so I keep my libraries in sync with a bitbucket server and source-tree.

Thanks!

Best Answer

The locations are hard-coded, absolute not relative, so you need to find & replace
file:///Volumes/Macintosh HD/Users/[yourname]/Music/iTunes/
with the actual path - file:///Volumes/mountpoint...

This would have been a single step find/replace on the iTunes Library.xml [which it is far better to keep in its original location even without the added complexity of a remote write] using something like TextWrangler/BBEdit if the library was consolidated to start with. As it isn't, you might have multiple steps to do, depending on how broad your "path-scape" is. .

It's been quite some time since I did this - the next step doesn't seem to work the same as it used to - see iTunes: Moving iTunes Files (Self Managed)

Breaking the .itl no longer works with recent iTunes versions - it just complains it's damaged & makes a new one itself, which loses everything.
I think last time I tried it I think I just left the .itl as it was & it ran OK (I'm open to correction on that if someone cares to try it, I'm not going to do it 'just to see' ;)

Related & possibly worth a read-through too, for general background & it also covers recent iTunes variations in method - How to share an iTunes library between Mac & Windows?

BTW, I think you ought to still be able to use 'Organise Media' using a remote library - though mine is just on a different drive, not a different server, so I haven't tested that scenario.