First of all, start by making a Lexicon backup (top menu) just to keep all your data safe so you can always go back.
For the empty Traktor; normally a sync to Traktor should give you your Lexicon library in Traktor, as you would expect. You can try another sync to Traktor, since the Traktor collection is now empty so there is no harm doing that. If it gives the same “collection is invalid” error again, then something else is going on. If so, can you upload the Documents/Native Instruments/Traktor 3.../collection_invalid.nml
file here? I’ll take a closer look and see why Traktor feels that it is broken. This would really help me fix that so it won’t happen again
After that, there is always the backup that Lexicon makes for Traktor that you can restore, see this link under Traktor: Backups and how to restore them
As for RB, it sounds like you didn’t have RB point to the generated XML yet. See Rekordbox | Lexicon - DJ Library Management