Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Recreate iTunes Library.itl: Step-by-Step Fix

· 4 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

If your iTunes library file (Library.itl) is corrupted, missing, or causing errors, you can recreate it. This forces iTunes to rebuild the library database from your media files, restoring playlists, ratings, and play counts where possible. You'll need your media folder intact and, ideally, a recent backup of your library.

What You'll Need

  • Access to your computer's file system (Windows Explorer or Finder).
  • Your iTunes media folder location (default: Music\iTunes\iTunes Media on Windows, ~/Music/iTunes/iTunes Media on Mac).
  • Optional but recommended: a backup of your current Library.itl and iTunes Library.xml files.

Step-by-Step

  1. Close iTunes completely. On Windows, check the system tray for the iTunes icon and quit it. On Mac, press Cmd+Q.
  2. Locate your iTunes folder. On Windows, it's usually C:\Users\[YourUsername]\Music\iTunes. On Mac, it's /Users/[YourUsername]/Music/iTunes. If you moved it, find the folder that contains Library.itl.
  3. Rename the existing library file. Find Library.itl and rename it to something like Library.itl.bak. This preserves it in case you need to revert. Do not delete it yet.
  4. Also rename the XML file (optional). If you have iTunes Library.xml, rename it to iTunes Library.xml.bak. This is not strictly necessary, but it prevents iTunes from using an outdated XML that might conflict.
  5. Launch iTunes. It will detect that the library file is missing and create a fresh, empty library. You'll see a welcome screen or an empty library.
  6. Add your media folder. Go to File > Add Folder to Library (Windows) or File > Add to Library (Mac). Select your iTunes Media folder. iTunes will scan and import all supported files.
  7. Wait for the import to finish. This can take a while if you have a large library. Do not interrupt it.
  8. Check your playlists and metadata. After import, playlists may be empty because they are not stored in the media files themselves. Ratings and play counts may also be lost unless they were in the XML file (which you renamed). If you want to try to recover them, see the Troubleshooting section.

Common Mistakes

  • Deleting the old file instead of renaming. Always rename, not delete, so you can revert if needed.
  • Not closing iTunes fully. If iTunes is still running in the background, it may recreate the old file or lock it.
  • Importing the wrong folder. Make sure you select the folder that contains your actual media files, not the iTunes folder itself (which contains the library files).
  • Expecting playlists to survive. Playlists are stored in the .itl file, so they will be gone after recreation. You'll need to recreate them manually.

Tips

  • Back up your library regularly. Copy the entire iTunes folder to an external drive or cloud storage.
  • Use the XML file for metadata recovery. If you have a recent iTunes Library.xml, you can use third-party tools to extract playlist and rating data.
  • Keep your media organized. If your files are scattered, iTunes may not find them all. Consolidate them first via File > Library > Organize Library (check "Consolidate files") before recreating.
  • Consider using Apple Music or the TV app. On newer macOS versions, iTunes is replaced by the Music app, but the library file structure is similar.

Troubleshooting

If iTunes does not create a new library: It may be using a different library file. Hold Shift (Windows) or Option (Mac) while launching iTunes and choose "Create Library" to start fresh.

If your media does not import correctly: Check that the files are in a supported format (MP3, AAC, etc.) and are not DRM-protected. Also ensure the folder path is correct.

If you want to recover playlists from the old library: Restore the renamed Library.itl.bak by quitting iTunes, deleting the new Library.itl, and renaming the backup back to Library.itl. This reverts to the old state.

If the new library is empty after import: You may have selected the wrong folder. Go to File > Add Folder to Library again and choose the correct media folder.

If iTunes crashes during import: Try importing smaller batches of files at a time. Also check for corrupted files in your media folder.

If you are using macOS Catalina or later: The steps are the same, but the app is called Music, and the library file is Music Library.musiclibrary (a package). To recreate it, rename that file and reopen Music.

Frequently Asked Questions

Will I lose my playlists?

Yes, playlists are stored in the library file and will not be recreated automatically. You'll need to rebuild them manually after importing your media.

Will I lose my ratings and play counts?

Ratings and play counts are also stored in the library file. However, if you have an iTunes Library.xml backup, some third-party tools can extract and reapply them.

Can I use the old Library.itl after recreating?

Yes, if you renamed it, you can restore it by quitting iTunes, deleting the new file, and renaming the backup back to Library.itl.

Does this work for Apple Music on macOS?

Yes, the process is similar. In the Music app, you would rename the Music Library.musiclibrary file and then add your media folder.

What if I don't have a media folder?

If your media is scattered, you can still add individual files or folders. However, it's best to consolidate them first using iTunes' Organize Library feature.

Is it safe to delete the old Library.itl after recreating?

Once you confirm the new library works and you have all your media, you can delete the backup. But it's safer to keep it for a while.