I think something similar has happened to me. It’s hard to tell because I just fixed the problem and didn’t delve to deep into the reasons. But it was just after installing a new version over an older version and some of the tables in a solution with a connection to MySQL lost their primary key sequence. You’ll have to search for the highest current pk value and reset your pk incrementation accordingly.
The next time I upgrade my production server, I am going to export all of my solutions, do a clean install, recreate all custom data connections, and then import the solutions.
In my case, it has been several months since it has happened so no old backups left. I did have it happen a number of times though so I’ll try to be aware of the situation if it comes up again.