It's mostly solved. I recreated the flash drive, then restored appdata. This seemed to work for everything except the Plex database. I would prefer not to lose watch history, otherwise I would simply rebuild it.
EDIT: in the most recent appdata backup, the Plex db was corrupted. I restored the previous one, so lost 2 weeks of watch history, but I can live with that. Everything seems back to normal. To me, this incident proves the value of backups of appdata, flash and data.