geonode
geonode copied to clipboard
Improve migrate_baseurl for mapstore2 and geoserver data_dir
Is your feature request related to a problem? Please describe.
- migrate the URL of a geonode instance
- try to add a map on a geostory
- The result is that mapfeatures are not loaded as the resource is still pointing to the old domain. (can be easily checked via the /mapstore/rest/ endpoint)
Describe the solution you'd like
To fix this problem I'm currently doing the following:
Replace URLs in postgres
UPDATE
mapstore2_adapter_mapstoredata
SET
"blob" = REPLACE("blob"::text,'A.csgis.de','B.csgis.de')::jsonb;
Replace metadatalinks in geoserver data dir
find /geoserver_data -type f -name "*.xml" -print0 | xargs -0 sed -i 's#A.csgis.de#B.csgis.de#g'
curl -u admin:password -v -XPOST http://localhost:8080/geoserver/rest/reload
While this is working, I'd like to suggest extending the migrate_baseurl management command to also update mapstore2_adapter_mapstoredata next to geoserver data directory
With GeoNode 4 now you have the "sync" button for maps, geostories and dashboards. Unfortunately there's no easy way to automate this, since GeoNode completely ignores the MapStore config content. We might consider to add a flag to the resource models to notify the client that a sync is required, and let the client sync automatically without user intervention.