Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration form Version 3.2 to 4 – map config is missing #9252

Closed
t-book opened this issue Apr 29, 2022 · 8 comments
Closed

Migration form Version 3.2 to 4 – map config is missing #9252

t-book opened this issue Apr 29, 2022 · 8 comments
Assignees
Milestone

Comments

@t-book
Copy link
Contributor

t-book commented Apr 29, 2022

@afabiani @giohappy did we oversee some already included migration or task?


When migrating a GeoNode 3.2 instance to GeoNode 4 (current master), the maps are not loading.
This as the blob coloumn in resource_base, which holds the map configuration is empty.

The map definition in versions prior to 4 kept this data in mapstore2_adapter_mapstoredata.
Further the new version of mapstore expects the existence of a map key/value, which might be missing in older map definitions.

Describe the solution you'd like
A django migration that copy needed data and taking care of a correct json scheme.

In conversation with @davekennewell, Dave provided a migration that covers most of the work.
What is missing is some kind of validation and/or adding missing keys from ancient map definitions.

See
Hydrata@b1b275a

@t-book t-book added feature A new feature to be added to the codebase 4.0.x labels Apr 29, 2022
@t-book t-book added this to the 4.0.0 milestone Apr 29, 2022
@giohappy
Copy link
Contributor

giohappy commented May 6, 2022

@t-book in theory the upgrade should work seamlessly since the migrations have the needed code to migrate maps data.
We will make some tests internally, in case something is missing, in particular from 3.2 to 4

@giohappy giohappy added investigation and removed feature A new feature to be added to the codebase labels May 6, 2022
@mattiagiupponi
Copy link
Contributor

Hi @t-book, @giohappy
Starting from the migration provided, I add another couple of checks to make the migration safer (it migrate also the attributes) and the migration has been moved under the client app instead of the GeoNode maps app.

The PR is available here: GeoNode/geonode-mapstore-client#959
I tested on a local instance:

  • the creation of the DB with the 3.2.x version
  • apply migration
  • map creation
  • checkout to master
  • run migrations
  • the maps work smoothly

@gannebamm
Copy link
Contributor

Is there any documentation on migrating from 3.3 / 3.2 to 4 available?

@giohappy
Copy link
Contributor

giohappy commented Jun 1, 2022

@gannebamm in theory running the migrations should be enough. We have tried to make the transition as smooth as possible, without any manual intervention or custom commands to apply.

@davekennewell
Copy link

Yes, @gannebamm - for me now, the core geonode migration "just worked". Just pull the new code & run migrations.

If you're using geonode-project, I found the easiest thing to do was create a fresh 4.x project with the same name as my existing, and then merge my 3.2.x code into the fresh 4.x structure. It's a bit finicky but now I'm confident it's working well. I used the same strategy for geonode-mapstore plugins and no problems their either.

@giohappy giohappy modified the milestones: 4.0.0, 4.0.x Jul 6, 2022
@t-book
Copy link
Contributor Author

t-book commented Aug 16, 2022

@mattiagiupponi I have the case where the json string from geonode 3.2 mapstore_adapter is migrated as string in the resourcebase blob field (masked quotes). And hence cards to not work.
Did you ever run into this?

@Inogeo
Copy link

Inogeo commented Aug 18, 2022

Not sure this can help/ is relevant

I share this work with you, i could migrate from 3 to 4 using this:

Generate backup:
https://github.com/Inogeo/spade/blob/5c314a6a04b9571bd64e7def4dca793a7e85ccce/geonode-backup.sh

Restore backup:
https://github.com/Inogeo/spade/blob/5c314a6a04b9571bd64e7def4dca793a7e85ccce/geonode-restore.sh

I created this django/python command to re-assign properly permissions once the migration is done.
https://github.com/Inogeo/spade/blob/5c314a6a04b9571bd64e7def4dca793a7e85ccce/geonode/api_spade/management/commands/reassign_permissions.py

The migration seems to be working properly on my side, except for thumbnails... I can bring some additionnal docs on *.sh files if you are interrested.

@afabiani afabiani modified the milestones: 4.0.x, 4.0.1 Aug 24, 2022
@mattiagiupponi
Copy link
Contributor

@mattiagiupponi I have the case where the json string from geonode 3.2 mapstore_adapter is migrated as string in the resourcebase blob field (masked quotes). And hence cards to not work. Did you ever run into this?

Just as info, the discussion continues here -> GeoNode/geonode-mapstore-client#1148

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants