Skip to content

Upgrade a GeoNode 4 project to 4.0.3

Giovanni Allegri edited this page Feb 24, 2023 · 3 revisions

This is a general guideline in order to help upgrading GeoNode version 4.0.2 to 4.0.3

The most important upgrade regards the GeoServer version, which must be updated from the recommended one for GeoNode 4.0.2 which is 2.20.5 to the latest 2.20.7 version which provides important security features.

Upgrade the GeoNode version to 4.0.3

Make sure you also update GeoNode to the 4.0.3 version. In order to do that you will need to update the requirements.txt file accordingly

GeoNode==4.0.3

Upgrade the GeoServer version to 2.20.7

You will need to change all the references to the previous Geoserver version inside the relevant files. You can see the affected files inside the the commit that was applied to geonode-project itels itself.

From your project folder, run the following command:

find ./ \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i 's|2\.20\.5|2\.20\.7|g'

WARNING: This will also update the docker-compose.yml docker image of GeoServer. No worries, the GeoServer catalog will be preserved and automatically updated. Just make sure you are using the default image and not a custom one.

The last change is to add an option to the GeoServer JAVA_OPTS. You will need to change the .env file by adding the option -Dgwc.context.suffix=gwc to the GEOSERVER_JAVA_OPTS variable:

GEOSERVER_JAVA_OPTS=-Djava.awt.headless=true -Xms2G -Xmx4G -Dgwc.context.suffix=gwc -XX:+UnlockDiagnosticVMOptions -XX:+LogVMOutput -XX:LogFile=/var/log/jvm.log -XX:PerfDataSamplingInterval=500 -XX:SoftRefLRUPolicyMSPerMB=36000 -XX:-UseGCOverheadLimit -XX:+UseConcMarkSweepGC -XX:ParallelGCThreads=4 -Dfile.encoding=UTF8 -Djavax.servlet.request.encoding=UTF-8 -Djavax.servlet.response.encoding=UTF-8 -Duser.timezone=GMT -Dorg.geotools.shapefile.datetime=false -DGEOSERVER_CSRF_DISABLED=true -DPRINT_BASE_URL={geoserver_ui}/geoserver/pdf -DALLOW_ENV_PARAMETRIZATION=true -Xbootclasspath/a:/usr/local/tomcat/webapps/geoserver/WEB-INF/lib/marlin-0.9.3-Unsafe.jar -Dsun.java2d.renderer=org.marlin.pisces.MarlinRenderingEngine

Rebuild the Docker Images

It will be necessary to rebuild the docker images and restart the containers. No worries, your volumes and DB will be preserved.

docker-compose build django celery geoserver
docker-compose up -d