As stated By Laurenz, you must install PostGIS in the same schema in both databases.
Afterward, it is possible to migrate postgis extensions doing the following : https://www.postgis.net/2017/11/07/tip-move-postgis-schema/
The migration can be done in an intermediate DB if need be.
You cannot do that. Install PostGIS in the same schema in both databases. That shouldn't be a problem in the new database.
The alternative would be to manually edit the dump file, which is tedious and error prone.