It seems that there also is a command line utility that can be used to restore a corrupt database using the saved metadata in Opf-files. That way you don't have to create a new library and add the books, might be faster but the end result should be identical.
http://manual.calibre-ebook.com/cli/...store-database