[GeoNode-users] Missing columns after migrating data from Geonode 2.4 to 2.6

Eric Goddard egoddard1010 at gmail.com
Mon Oct 16 07:24:40 PDT 2017


Hi all,

We're trying to upgrade from GeoNode 2.4 to 2.6. I have a new VM with
Geonode 2.6 installed on Ubuntu 16.04 from the PPA. I dumped the
postgres data from our 2.4 server and created new DBs on the Geonode
2.6 instance and updated settings.py to point to the geonode 2.4
geonode and geonode_data DBs.

Following the suggestion in this thread
(http://osgeo-org.1560.x6.nabble.com/Help-for-migrate-data-from-2-4-to-2-6-td5323208.html),
I ran geonode migrate --fake-initial and everything appears to have
worked, however if I try to create a new account from the geonode
registration page, or delete an existing account from the admin panel
I get some errors.

Trying to create a new account results in the following error:
IntegrityError: null value in column "last_login" violates not-null constraint

 Trying to delete an account results in the following error:
ProgrammingError: column upload_upload.mosaic_time_regex does not exist

It looks like the migration didn't run correctly. If anyone has advice
on how fix/work a round this issue it would be greatly appreciated!
We'll be reloading the data anyway so our main concern is just
migrating the accounts and groups.

If it helps, here is the comparison of the geonode 2.4 and 2.6 schemas
for the upload_upload table. The mosaic* columns are missing from the
2.4 database that was migrated:

geonode 2.4 database (after running migrate):
geonode24=# \d upload_upload
                                    Table "public.upload_upload"
   Column   |           Type           |                         Modifiers
------------+--------------------------+------------------------------------------------------------
 id         | integer                  | not null default
nextval('upload_upload_id_seq'::regclass)
 import_id  | bigint                   |
 user_id    | integer                  |
 state      | character varying(16)    | not null
 date       | timestamp with time zone | not null
 layer_id   | integer                  |
 upload_dir | character varying(100)   |
 name       | character varying(64)    |
 complete   | boolean                  | not null
 session    | text                     |
 metadata   | text                     |
Indexes:
    "upload_upload_pkey" PRIMARY KEY, btree (id)
    "upload_upload_layer_id" btree (layer_id)
    "upload_upload_user_id" btree (user_id)
Foreign-key constraints:
    "upload_upload_layer_id_fkey" FOREIGN KEY (layer_id) REFERENCES
layers_layer(resourcebase_ptr_id) DEFERRABLE INITIALLY DEFERRED
    "upload_upload_user_id_fkey" FOREIGN KEY (user_id) REFERENCES
people_profile(id) DEFERRABLE INITIALLY DEFERRED
Referenced by:
    TABLE "upload_uploadfile" CONSTRAINT
"upload_uploadfile_upload_id_fkey" FOREIGN KEY (upload_id) REFERENCES
upload_upload(id) DEFERRABLE INITIALLY DEFERRED

Geonode 2.6 database (from initial install):
geonode=# \d upload_upload
                                       Table "public.upload_upload"
      Column       |           Type           |
 Modifiers
-------------------+--------------------------+------------------------------------------------------------
 id                | integer                  | not null default
nextval('upload_upload_id_seq'::regclass)
 import_id         | bigint                   |
 state             | character varying(16)    | not null
 date              | timestamp with time zone | not null
 upload_dir        | character varying(100)   |
 name              | character varying(64)    |
 complete          | boolean                  | not null
 session           | text                     |
 metadata          | text                     |
 mosaic_time_regex | character varying(128)   |
 mosaic_time_value | character varying(128)   |
 mosaic_elev_regex | character varying(128)   |
 mosaic_elev_value | character varying(128)   |
 layer_id          | integer                  |
 user_id           | integer                  |
Indexes:
    "upload_upload_pkey" PRIMARY KEY, btree (id)
    "upload_upload_7a39a38c" btree (layer_id)
    "upload_upload_e8701ad4" btree (user_id)
Foreign-key constraints:
    "u_layer_id_6346de911330a880_fk_layers_layer_resourcebase_ptr_id"
FOREIGN KEY (layer_id) REFERENCES layers_layer(resourcebase_ptr_id)
DEFERRABLE INITIALLY DEFERRED
    "upload_upload_user_id_7fad116c8478bf31_fk_people_profile_id"
FOREIGN KEY (user_id) REFERENCES people_profile(id) DEFERRABLE
INITIALLY DEFERRED
Referenced by:
    TABLE "upload_uploadfile" CONSTRAINT
"upload_uploadfil_upload_id_21ef448d17dd4b6b_fk_upload_upload_id"
FOREIGN KEY (upload_id) REFERENCES upload_upload(id) DEFERRABLE
INITIALLY DEFERRED


Thanks!

Eric


More information about the geonode-users mailing list