Error with pg_upgrade and PostGIS
How should I proceed?


I would try to load the newer version of PostGIS fresh on a 9.6 before you load your dataset. If successful, I would edit the dataset to remove anything to do with PostGIS's internal functions. I would then load my dataset without those offending functions (make sure whatever you're loading does not have PostGIS internal stuff).

Also worth mentioning PostGIS 2.0 is EOL already and unsupported.