[GeoNode-users] R: migration suggestions
frippe12573 at hotmail.com
Sat Mar 21 06:20:19 PDT 2020
thank you to have answered to mail last email.
My situation is the following:
* I have a geonode 2.4 running on a server 'A' configured to run as multi-site which embeds something like 120 layers, 20 maps and 3 users. In server 'A' is running ubuntu 14.04, which is obsolete.
* I have also server 'B' where ubuntu is at the version 18.04.
* I want to migrate my genode 2.4 running instance as multisites from server 'A' to 'B'.
* I have asked some weeks ago here in the list what would have been the best solution, consider I'm not a developer and I never used the virtualenv. I installed the 2.4 version for production.
* For the migration I was following some suggestions from Alessio:
1. Setup a new GeoServer 2.15.2 ( https://build.geo-solutions.it/geonode/geoserver/latest/geoserver-2.15.2.war )
2. Transfer the Data Dir from the old GeoServer to the new one (I strongly suggest to backport **only** the workspace, datasets and styles, not the security subsystem)
3. Setup the new GeoNode instance
4. Run the "updatelayers" management command (see http://docs.geonode.org/en/master/admin/mgmt_commands/index.html#management-command-updatelayers )
5. Update manually the missing permissions and metadata
* I completed step 1 with geoserver 2.16.2 - I installed the data_dir outside geoserver - and it runs fine
* I completed step 2 and I'm able to see all the layers I had in server 'A'
* I set up a fresh geonode instance, even thanks to you help. I installed geonode from GIT, so I should have the master version (2.10).
* Within the step 2 I restored in server 'A' the two postgresql db I had inserver 'A'
* Since I remembered some steps of the custom configuration I did for version 2.4 (and I never used NGINX) I configured APACHE2.
* Currently in server 'B' I'm able to see the geonode home page, but I cannot see my layers as well as I cannot enter as administrator.
* I followed you suggestions and I
* ALTER TABLE public.layers_layer DROP COLUMN service_id
* and I gave the command
* django python manage.py migrate --fake-initial
* but I'm still not able to enter as administrator
* I realized even that the db schema apparently didn't change (e.g. I had 75 tables in the old version and I still have 75 tables in the newer version, I don't if the fields are modified instead)
* to have the version 2.10 running I followed your suggestion to insert my domain in the ALLOWED_HOSTS variable inside local_settings.py. I did it but it didn't work as long as I insert the same in settings.py. For this reason I'm supposing that local_settings.py is not active in some way and for the same reason it doesn't allow to connect to the db. Am I right?
Once the administrator login will be solved:
* I should configure this new running geonode instance for multisites - Could I restore in someway the look & feels I had in the old instance?
* check the authorization between geonode and geoserver
I hope this can help you to have a clearer vision of 'whats going on'...
Da: Toni Schönbuchner <toni.schoenbuchner at csgis.de>
Inviato: sabato 21 marzo 2020 13:45
A: Eugenio Trumpy <frippe12573 at hotmail.com>
Cc: geonode-users <geonode-users at lists.osgeo.org>
Oggetto: Re: migration suggestions
I would need to have a look what is going on. But yes local_settings should override settings.
The correct command for migrations is python manage.py migrate ... (instead of syncdb)
Am 20.03.2020 um 19:58 schrieb Eugenio Trumpy <frippe12573 at hotmail.com<mailto:frippe12573 at hotmail.com>>:
I followed your hints.
I put the domain in the ALLOWED_HOSTS and now I visualise the home page.
Just a question, I had to put the domain the settings.py file because it didn't work in local_setting.py, why? Don't local_setting override setting.py?
Then I modify local_setting.py to set credential to access geonode db.
Then I alter the table you suggested and I run python manage.py --syncdb but the number of tables didn't change, is that correct?
The geonode home page is visualised but I'm not able to enter with the old administrator credential.
I presume there is no connection with the db. Should I use again setting.py instead of local_setting.py?
Thanks in advance,
Da: Toni Schönbuchner <toni.schoenbuchner at csgis.de<mailto:toni.schoenbuchner at csgis.de>>
Inviato: giovedì 19 marzo 2020 20:37
A: Eugenio Trumpy <frippe12573 at hotmail.com<mailto:frippe12573 at hotmail.com>>
Cc: geonode-users <geonode-users at lists.osgeo.org<mailto:geonode-users at lists.osgeo.org>>
Oggetto: Re: migration suggestions
> • I set the wgsi module in apache2. The geonode is served now with the 'allowed_hosts' error. I think the issue could be related to the settings. In the 2.4 version I remember I set SITE_URL, should I set something similar even in this version?
Allowed hosts is a security mechanism by Django to define Domains that serve your instance.
To overcome an 504 error you can add something like
ALLOWED_HOSTS = ['localhost' '127.0.0.1' 'your domain.com<http://domain.com>']
to your settings.py or local_settings.p However, we all more and more avoid touching the settings file and try to configure everything
with environment variables. So with a manual setup you can try to add it to your uwsgi config:
> • I created a geonode postgresql empty db, while I restored the backup from that I was using in 2.4 version. How I should populate with the new data-schema the geonode metadata db? I remember there was the command python manage.py --syncdb, does still exist? I tried but I got error.
I'm unsure If I correctly understand. But the rough flow looks like:
• Export your geonode 2.4 Database
• Import it to a fresh Database
• Be sure to correctly set permissions for your User
• Change your settings.py for using the new database and in case the correct user
• Fix some inconsistency within your new database. Run f.e. with pgadmin or by psql from console
• ALTER TABLE public.layers_layer DROP COLUMN service_id
• Run the migrations, this should update your database scheme from 2.4 to 2.10
• DJANGO_SETTINGS_MODULE=YOURGEONODE.local_settings django python manage.py migrate --fake-initial
You will need to change those commands to fit your setup further run into errors here and
there but hopefully this steps help you to find out of the forest.
Halle 18 04179 Leipzig
Hinweis gemäß § 33 BDSG
Daten der Verfahrensbeteiligten werden gespeichert. Dieses Dokument ist ausschließlich für den
Adressaten bestimmt. Der Inhalt der E-Mail ist vertraulich. Falls Sie diese E-Mail versehentlich
erhalten haben, rufen Sie uns unter obiger Rufnummer umgehend an und löschen Sie diese Nachricht
von Ihrem Computer. Jegliche Art von Reproduktionen, Verbreitung, Vervielfältigung, Veränderung,
Verteilung und/oder Veröffentlichung dieser E-Mail ist verboten.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the geonode-users