Fixing a locked iTunes Library

So something happened (likely your computer abruptly shut down) and now iTunes is giving you an error message that your Library file is locked:

This is easy enough to fix:

  1. Close iTunes
  2. Move all files from the root of your iTunes library folder to another location
  3. Open iTunes which will create some new files in your iTunes library location
  4. Close iTunes
  5. Move the original .ITL and .xml file back to your iTunes library location (overwriting any new files just created)
  6. Open iTunes and your library should be back to normal