Start by making a copy of the calibre folder, just to be safe. Check the preferences, and make sure that metadata is read from inside the books, not from the file name. Then create a new library and add the books in the old calibre folder. Make sure to specify that each folder has the same book in different formats.
That is alternative 2. in the manual:
http://manual.calibre-ebook.com/gui.html#add-books