If the folder structure and ebooks are intact, you can open the corrupted library, right-click on the Library icon (toolbar) and select Library Maintenance ==> Restore database.
calibre will attempt to recreate your library based on the folder structure and the backup metadata.opf files.
As for importing into the new library, try the
[GUI Plugin] Find Duplicates. It can compare across libraries to help you deduplicate. Weed out the duplicates in the old library, then once you have cleaned up, you can simply right-click on the leftover books and select Copy to library.
You might want to make a backup of the old library folder before deleting things.