This is why “install a new environment and restore a backup” is not the best solution. You still have leftovers from old components and plugins hanging in the database.
There should be a last-effort tool that strips out any component and plugin changes to the database and leaves the data and site settings alone. This tool could be run before going to the new install solution.