I had the same problem after a move, but found the idea for a solution here.
Basically what I did was create a new dummy post, and assign every single category to it. That way the mapping got updated in the DB, and everything was back to normal.
I’d really like to second mreddy’s question. It would be greatly needed on my side. TIA