Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have my FreeNAS box setup and running with three 500GB drives in a RAID-Z1 pool (yee-haw!) and now I'm working on copying my iTunes library from my Macbook over to a share on the FreeNAS box. Later, I will be wanting to copy over the library from my desktop PC (Windows Vista). Most articles & posts I've found on the 'Net seem to deal primarily with accessing the files once they are on the server; what I'm more concerned about at this point is making sure I don't clobber anything unintentionally (and irrevocably!).

Basically I'm using sftp via Filezilla to copy my iTunes directory (/Users/monte/iTunes) to a directory on the server (/mnt/storage/media/itunes/iTunes). All is well and good, and should get done... eventually ;) But when I go to sftp the library from the PC across... won't some of the configuration files/databases in the iTunes directory on the server either get skipped or over-written? Whats the best way to handle this?



share|improve this question
I don't use iTunes because of the library snafu. I just use a different third party player, or deal only with the mp3 files and then "update the library" with local media files to get past the permissions issues. a bricked ipod/iphone should not remove the users music from their library...just my 2 cents – RobotHumans Oct 4 '10 at 16:32
up vote 2 down vote accepted

Note: This is from memory and untested. I would backup everything before you attempt this, just in case!

There are two iTunes library files:

\Documents and Settings\username\My Documents\My Music\iTunes\iTunes Library.itl
\Documents and Settings\username\My Documents\My Music\iTunes\iTunes Music Library.xml

Provided you don't overwrite these, then you should be able to merge the folder structure successfully. The problem you are going to have is having one iTunes library which contains the music and meta-data for both libraries.

The way I'd do this is close iTunes on the PC you're going to use to merge the data, locate the iTunes Library.xml file and append to the bottom of it the contents of the iTunes Library.xml file on the other computer. You may need to tweek the XML so that it's syntactically correct.

Once you've done this, you'll need to do a search and replace so that the path to the location of the music is correct. When you've finished you should have an XML file which points to the right location on your NAS of your music files.

Finally, delete the iTunes Library.itl file on the PC and replace it with a blank file of the same name.

If you've done this correctly, then when you run iTunes it'll claim your database file is corrupt and rebuild the database from the XML file.

The only issue you'll now have is a bunch of duplicates where you have two entries in the XML file pointing to the one file on your NAS (because sftp overwrote it). You should be able to remove those by using the "Show Duplicates" option within iTunes.

I'm not sure if you can store the iTunes database remotely on the NAS. If you want to do this then when you've done all the steps above you should be able to close iTunes and copy that folder to the NAS and then point iTunes to that. I'm not sure what the steps would be for that though.

share|improve this answer
Thinking about it, you would want to store the database on the NAS otherwise you get the odd situation where you upload music from one computer (which then sees those files because they are in its database) but the other computers don't see them (because they aren't in their database). – Richard Oct 4 '10 at 17:04
Well, I'll be giving it a go here in a few hours when I finish up sync'ing the first library. It'll be a while (like day or two) before I get the second one finished, as it's considerably larger ;) – memilanuk Oct 4 '10 at 22:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.