GeoNode / geonode

GeoNode is an open source platform that facilitates the creation, sharing, and collaborative use of geospatial data.
https://geonode.org/
Other
1.43k stars 1.12k forks source link

Primary keys of tables not carried over on Backup-Restore #7301

Closed jcaceres85 closed 7 months ago

jcaceres85 commented 3 years ago

Expected Behavior

Update from Geonode 3.0 to 3.1, using commandos Backup/Restored. Keep same functionality, styles, layers and Maps.

Actual Behavior

Everything looks good in the Web interface, however, trying a WFS request to geoserver has the following error:

java.io.IOException java.lang.RuntimeException: java.io.IOException java.io.IOExceptionCannot do natural order without a primary key, please add it or specify a manual sort over existing

Looking at the tables in the database (geonode_data) none of the tables have a defined primary key field, causing the error.

To fix the problem I had perform pg_dump on old database, delete all tables created after the Restore commando, and dump the old database into the new one. So it maybe something from the Backup/Restore commando that doesn't get carried over.

Steps to Reproduce the Problem

  1. Run python manage.py backup command on old version.
  2. Update Geonode to new version
  3. Run python manage.py restore on new deployment
  4. Perform a WFS request to the Geoserver

Specifications

giohappy commented 3 years ago

The B/R mechanism has been refactored and enhanced a lot in recent versions. No activities are planned for the versions mentioned in this issue.