geosolutions-it / geonode-project

A django template project for creating custom GeoNode projects.
http://geonode.org
0 stars 5 forks source link

B/R - Geonode backup-restore does not work properly #36

Closed bieganowski closed 3 years ago

bieganowski commented 3 years ago

When setting up Geonode using docker-compose (https://github.com/GeoNode/geonode/blob/master/docker-compose.yml), and performing Backup/Restore procedures - everything is restored but the postgis table containing the layer data (the layer is visible in Geonode and it is present in Geoserver, but data is not loaded in both places).

The part that is responsible for dumping the data fails silently at https://github.com/GeoNode/geonode/blob/d888a6c6b7cfe386e1153d8f3bbee3b5b974d19b/geonode/br/management/commands/utils/utils.py#L275. Most likely the Geonode image is missing postgres-client, since both pg_dump and pg_restore commands are missing in the container.

Test of Geonode's B/R was performed as follows:

  1. loading a layer in Geonode (UI)
  2. creating backup directory mkdir /geoserver_data/data/backup
  3. executing backup with python manage.py backup -c /usr/src/geonode/geonode/br/management/commands/settings_docker_sample.ini --backup-dir /geoserver_data/data/backup
  4. removing the layer (UI)
  5. restoring the backup python manage.py restore -c /usr/src/geonode/geonode/br/management/commands/settings_docker_sample.ini --backup-file /geoserver_data/data/backup/<generated-archive>