Help me avert an iTunes disaster!
November 13, 2007 7:34 PM   Subscribe

My wife is going to kill me. While "fixing" her computer (g5 Macintosh running Leopard), I managed to move 20,000 of her mp3s to the trash. I actually thought I as moving one genre with "select-all", but apparently I moved the entire frickin' library. She doesn't know yet, but it's only a matter of time. I have not yet deleted these files. All 20,000 (well, 19,868) are sitting in the trash can. There's no "restore to previous location" type option, though. Help! Is there anything I can do? Is my only option to have iTunes re-import the entire lot?

Fortunately, I backed up everything on her hard drive recently, just before installing Leopard.
posted by jdroth to Computers & Internet (29 answers total) 3 users marked this as a favorite
Move it out of the trash back ?
posted by iamabot at 7:39 PM on November 13, 2007

You should be able to just drag it all back to where it came from.
posted by ThePinkSuperhero at 7:40 PM on November 13, 2007 [1 favorite]

Yeah, you're safe. Drag them back out and put 'em where you found 'em.

Don't worry.
posted by SansPoint at 7:41 PM on November 13, 2007

right click or ctl click on the trash can. do you see the restore option?
posted by caddis at 7:42 PM on November 13, 2007

Check under the Edit menu for 'Undo Move to Trash.' If it's not available, just manually drag-and-drop them where they were originally located (defaults are Your Username/Music/iTunes Music).
posted by porn in the woods at 7:43 PM on November 13, 2007

In the trash can, select all and try dragging them into iTunes' window.

Or if all else fails, drag it to a folder on the desktop and from there drag them into iTunes' window as you would new material.
posted by icebourg at 7:50 PM on November 13, 2007

icebourg's solution is the last you should try. Just moving them back to the original location, will suffice. You can look at iTune's preferences if you forget where they were (Pref. menu, advanced I think). If, for some reason (??) that doesn't work and iTunes won't recognize them after you start it up again, then you should drag the folder into iTunes and walk away for a day or so (20k tracks will take a looong ass time to catalog). The point is to try and avoid cataloging them again by putting them exactly where they were before. iTunes won't know the difference.

Next time use the delete button. It will ask you if you want them out of the library and also if you want to move them to the trash, or leave them.
posted by a_green_man at 7:59 PM on November 13, 2007

Just drag the stuff out of the Trash and put it back, as if you accidentally dropped her favourite necklace in the garbage can.

Then buy your wife a massive second internal or external hard drive so she can back up her entire computer. No, seriously.
posted by Mikey-San at 8:01 PM on November 13, 2007

Okay, let me give you some more information.

The reason I was "fixing" this computer is that there was only ~1gb of space left on the hard drive. I was deleting songs she does not listen to. I was deleting them from within iTunes, one genre at a time. So, these files were moved from iTunes to the trash, not from the Finder to the trash.

So, right now iTunes shows a library containing zero songs. It has no undo option available.

The files are in the trash without any sort of associated folders. (Which is expected behavior based on how they got there.)
posted by jdroth at 8:11 PM on November 13, 2007

I'd say drag out of the trash into a new folder, then import them into iTunes from that folder.

That way, iTunes will rebuild all the crazy directories and genres and read the metadata into its library.
posted by mathowie at 8:13 PM on November 13, 2007

(And to be clear: there are about 80gb of music in the trash. With only 1gb free on the hard drive, there's no way I'm going to be able to make duplicates on the desktop or anywhere else. But like I say, I did back up everything before installing Leopard, so worst-case scenario I can just delete what's in the trash, copy over all the songs from the backup drive, and we're back to where we started.)
posted by jdroth at 8:13 PM on November 13, 2007

My wife hates it when I try to "fix" her computer. Stuff like this always happens.
posted by jdroth at 8:14 PM on November 13, 2007


Just turn it on and leave it there for the moment. Since you've actually deleted files as opposed to just moving to the trashcan, you've got a big problem. But it can possibily be fixed, if you don't use the computer at all. Just turn it on and leave it there.

When you delete something from a computer, it's not actually deleted, the operating system is just told, "Oh, you can overwrite these files". So most of the stuff is still there and there are utilities to help you recover that data. I don't know what they are, someone else will probably be along to chime in, but in the meantime, don't use the computer at all.
posted by Brandon Blatcher at 8:19 PM on November 13, 2007

I haven't installed Leopard yet, but isn't Time Machine supposed to be able to restore your system to the previous hour, day, week, month, whatever?
posted by HotPatatta at 8:19 PM on November 13, 2007

if you have a backup, hook that drive up and copy the iTunes folder into her home directory's Music folder. Launch iTunes and if it asks you to point it to the library, just navigate to the HomeDirectory/Music/iTunes folder and hit OK. That should restore all the songs as well as the iTunes database w/ playcounts, ratings, playlists and a few other nifty things.
posted by hummercash at 8:23 PM on November 13, 2007

HotPatatta, Time Machine will only work if you enable it and have another hard drive. The fact that this one was so full leads me to believe that there is no other drive for them to dedicate to Time Machine.
posted by hummercash at 8:26 PM on November 13, 2007

I started to run Time Machine, but the damn thing was so sluggish (as Leopard is, as a whole, on a 1.8ghz single processor g5) that I stopped it. I was freeing up hard drive space so I could run it when this occurred.

I think hummercrash has the best idea so far: I'll just copy the backup music files from the external drive to their old location and then point iTunes at them. I'll give that one a try.

The added bonus is that I can then delete the 80gb of files in the trash to see if that actually makes Leopard run any faster on this machine. I'm guessing it will, but who can say. It runs like molasses on my 1.33ghz g4 Powerbook. I wish I could just Time Machine Leopard right off that computer...
posted by jdroth at 8:31 PM on November 13, 2007 [1 favorite]

The problem with re-importing could be that things like playlists and ratings (if your wife uses them) get nixed. What you probably want to do, if restoring from backup, is as follows:

1. Check the iTunes preferences to see if she lets iTunes organise the library.

2. If so, you'll just need to restore the ~/Music/iTunes Music folder, with its iTunes Music Library.xml file.

3. If not, things get trickier.
posted by holgate at 8:38 PM on November 13, 2007

I'll copy the files over during the night. If I have more questions, I'll post back here. Thanks for the tips so far. I appreciate it.
posted by jdroth at 8:58 PM on November 13, 2007

I don't know exactly how to do this on a mac, but I've done it on a PC:
- iTunes keeps your library in two file formats: the binary library it usually reads from, and an XML version it can rebuild from if your binary library gets corrupted.
- since you deleted the songs from within iTunes, your binary library now reflects a library of 0 songs (oh no!) but I'm 75% sure that the XML library is only updated periodically, like maybe each time you close iTunes or something. I hope you haven't done that yet.
- first, navigate to your music/itunes library folder and make copies of the two library files before you start messing with them (put them somewhere safe!)
- move your actual music files from the trash back into their respective folders. Again, if iTunes erased the directory structure, you may have to restore from a backup instead. iTunes won't see them yet, but at least they're back in their rightful spot, and the next steps will encourage iTunes to remember them.
- close iTunes. Open the iTunes binary database file with a text editor and erase a chunk of it or type something witty, then save and close. your goal is to corrupt this database, which will force iTunes to rebuild from the XML database (no, you can't just delete the binary database file. It has to be there but be corrupted).
- copy your backup XML database back into the iTunes Library folder and start iTunes. If it worked, you'll see a dialog that says something like "rebuilding library" and it'll take a while, but you should get back pretty much everything, including playlists.
- the only things NOT stored in the XML database are iTunes-specific (non-ID3 standard) metadata, such as (I think) last played and play count. But if it works, that's a small loss in the grand scheme of things.
- Like I said, the XML database is generally a mirror image of the binary database, which might mean that your XML database also now has a whopping 0 songs in it. If that's the case, your best option is to grab the backup library and just start over from there.

It's been a while since I had to do this and I can't guarantee my memory. Hope it helps, though.
posted by Chris4d at 9:01 PM on November 13, 2007


Just turn it on and leave it there for the moment. Since you've actually deleted files as opposed to just moving to the trashcan, you've got a big problem. But it can possibily be fixed, if you don't use the computer at all. Just turn it on and leave it there.

Stop freaking the guy out. This isn't correct.

By default, when you delete something in iTunes, it does this:

Which means they're sitting in the Trash, as confirmed more than once by the OP:

The files are in the trash without any sort of associated folders.

And to be clear: there are about 80gb of music in the trash.
posted by Mikey-San at 9:02 PM on November 13, 2007

Once it's done the initial backup, time machine shouldn't be slow. I'm quite happy with it on my 1.3ghz ibook.
posted by Tomorrowful at 9:04 PM on November 13, 2007 [1 favorite]

My wife hates it when I try to "fix" her computer. Stuff like this always happens.

Not that this helps now but don't try to fix her computer in the future, especially since she hates it. If she asks for help you might give her advice but let her do the work, or pay someone else to. It sounds like this leads to unnecessary headache for both of you.

It runs like molasses on my 1.33ghz g4 Powerbook.

And, sorry to derail, is Leopard really that slow on G4 hardware? I've got a 1.5GHz PowerBook with 1.25GB RAM and having been planning on upgrading
posted by 6550 at 10:43 PM on November 13, 2007

If you really backed everything up, you may be able to empty the trash to free up hard drive space, then just copy over the entire iTunes folder from your backup into the Music directory. This will include the library and playlists and the like. Once you copy that folder into its rightful place, just start up iTunes. Everything should be back the way it was.

Make sure that you really backed it all up before trying this option. And maybe copy the files that are in the trash to an external drive if you can just in case before emptying the trash.

Otherwise, just move all of the files out of the trash and back into the iTunes Music folder (assuming that you were storing them in the default location and that Leopard isn't any different in that respect than 10.4. Then you can re-add them to iTunes. Since they're already where iTunes would have put them, there should be no worries about needing extra drive space. I don't think it will try to make extra copies that way. You'll lose playlists, but at least you won't lose any music.
posted by willnot at 11:02 PM on November 13, 2007

Okay, what it seems like happened is that you removed the songs from the iTunes Music Library, and moved them to the Trash.

All is not lost.

Yes, you need to re-import them to iTunes. First, I'd move them all out of the Trash, to an intermediate, safe location. (A folder on the Desktop, maybe.)

Then, go into iTunes and into Preferences, and see if "Keep my iTunes Music Library" is turned on. DISABLE it. Then drag all the music into the Library pane. It'll be scanned and added, but they should not be copied! (This is a *good* thing, since you probably don't have enough room on the hard drive to duplicate them all during the Import process.)

Now, and here's the key, go back in and turn the "organize" feature on. It should give you some sort of warning that all of your music is about to be filed away in your Music Library folder. Let it do it's thing, and it should move, rather than copy the files. (I'm not 100% if there might be an extra step here, maybe something in the Special menu, in order to get it to move all the music files into your library...not having iTunes in front of me I can't check, but it's definitely trivially doable.)

That should get all of the music back in the Library, organized, where it belongs.

Sadly, I think that she may lose all of her metadata (incl. playcounts, ratings, etc.) by doing it this way.

There is one alternative, which would preserve metadata...but it's more complicated. I'm not even sure that it'll work; it would involve going into the iTunes Music Library folder and seeing if there's a backup copy of the Library XML file around, making a copy of it, and replacing the current Library's XML file with it. That ought to bring all the songs back into iTunes' Library, but of course they won't play because the computer doesn't know where they are. You'd need to go through and manually retarget them (I don't know if there's a way to retarget them all at once).

Or, the third and final option, would be to use a restore-from-iPod utility, if she has her whole music library on her iPod. If you want to go down this route let me know and I'll get the name of the utility I used when I had to do this process...there is one of them around (I *think* it's Senuti but it might have been one of the other ones) which will copy from the iPod, preserving metadata, and drop the files into the Library, letting iTunes file them away. Very slick. Except that it had about a 1% failure rate which when you're talking about thousands of songs isn't trivial.

But you're right, this is kind of a mess. I question why you're doing this in the first place. Have you looked at the prices of hard drives recently? IMO, there is no reason to be throwing away anything but the most temporary and ephemeral data. Once you get the songs restored, I would get her a 500 or 750GB drive (about $150), maybe a bigger internal drive as well, set up Time Machine, and never delete anything again.
posted by Kadin2048 at 11:08 PM on November 13, 2007 [1 favorite]

Personally, I've got all my iTunes music on an external drive. I like having my system files on their own drive. But I'm picky like that.

Anywho, if you want to do something similar (and really, I'd recommend it), check Preferences -> Advanced -> General -> iTunes Music Folder Location and click "Change", then point it to a folder with all the MP3s. If they're not imported yet, no need to worry, iTunes will do it automatically if you select "Keep iTunes Music folder organized".

As for the slowdown w/Leopard (esp if you have Time Machine running) - check your Spotlight preferences. Dollars to Donuts says you probably don't have your TM backup drive in the "exclude" section. You should. Spotlight doesn't need to index backup files. It'll speed Leopard up quite a lot.
posted by revmitcz at 12:17 AM on November 14, 2007

6550: That's exactly the setup I've got, and Leopard runs just fine. I don't notice any performance degradation from Tiger. (It will be slow for a bit when you first boot into Leopard as Spotlight indexes your hard drive; Time Machine also takes forever to make its first backup.)
posted by magicbus at 4:58 AM on November 14, 2007

Magicbus & 6550 -- maybe the slowness I'm experiencing with my Powerbook is from the fact that I haven't let Spotlight finish doing its thing. (I use the Powerbook infrequently. Very infrequently.) I don't know. Leopard is damn slow on it at the moment, though.
posted by jdroth at 7:33 AM on November 14, 2007

do what Matt et al. said then buy an external hard drive
posted by matteo at 11:58 AM on November 14, 2007

« Older Did the Company ask me to do something illegal?   |   Birthday gift for a 19yo just out of rehab? Newer »
This thread is closed to new comments.