<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Dear Toni,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
thank you to have answered to mail last email.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
My situation is the following:</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="">
<ul style="color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">
<li>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. <span style="color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">In server 'A' is running
ubuntu 14.04, which is obsolete.</span></li><li><span style="color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">I have also server 'B' where ubuntu is at the version 18.04.</span></li><li><span style="color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">I want to migrate my genode 2.4 running instance as multisites from server 'A' to 'B'.</span></li><li><span style="color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">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.</span></li><li>For the migration I was following some suggestions from Alessio: </li></ul>
<div style="">
<blockquote style="color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; margin: 0px 0px 0px 40px; border: none; padding: 0px;">
<ol>
<li>Setup a new GeoServer 2.15.2 ( <a href="https://build.geo-solutions.it/geonode/geoserver/latest/geoserver-2.15.2.war" target="_top" rel="nofollow" style="font-size: 1em; color: rgb(85, 26, 139)">https://build.geo-solutions.it/geonode/geoserver/latest/geoserver-2.15.2.war</a> ) </li><li>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)</li><li>Setup the new GeoNode instance</li><li>Run the "updatelayers" management command (see <a href="http://docs.geonode.org/en/master/admin/mgmt_commands/index.html#management-command-updatelayers" target="_top" rel="nofollow" style="font-size: 1em; color: rgb(85, 26, 139)">http://docs.geonode.org/en/master/admin/mgmt_commands/index.html#management-command-updatelayers</a> )</li><li>Update manually the missing permissions and metadata</li></ol>
</blockquote>
</div>
</div>
<blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;">
<blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote>
</blockquote>
<ul>
<li><span style="color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">I completed step 1 with geoserver 2.16.2 - I installed the data_dir outside geoserver - and it runs fine</span></li><li><span style="color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">I completed step 2 and I'm able to see all the layers I had in server 'A'</span></li><li><span style="color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">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).</span></li><li><span style="color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">Within the step 2 I restored in server 'A' the two postgresql db I had inserver 'A'</span></li><li><span style="color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">Since I remembered some steps of the custom configuration I did for version 2.4 (and I never used NGINX) I configured APACHE2.</span></li><li><span style="color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">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.</span></li><li><span style="color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;">I followed you suggestions and I </span></li><li><span style="font-size: 12pt;">ALTER TABLE public.layers_layer DROP COLUMN service_id</span></li><li><span style="font-size: 12pt;">successfully</span></li><li><span style="font-size: 12pt;">and I gave the command </span></li><li><span style="font-size: 12pt;">django python manage.py migrate --fake-initial</span></li><li><span style="font-size: 12pt;">but I'm still not able to enter as administrator</span></li><li><span style="font-size: 12pt;">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)</span></li><li><span style="font-size: 12pt;">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? <br>
</span></li></ul>
<div>Once the administrator login will be solved: </div>
<div>
<ul>
<li>I should configure this new running geonode instance for multisites - Could I restore in someway the look & feels I had in the old instance?</li><li>check the authorization between geonode and geoserver<br>
</li></ul>
<div>I hope this can help you to have a clearer vision of 'whats going on'...</div>
</div>
<div><br>
</div>
<div>Best regards,</div>
<div><br>
</div>
<div>Eugenio</div>
<div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Da:</b> Toni Schönbuchner <toni.schoenbuchner@csgis.de><br>
<b>Inviato:</b> sabato 21 marzo 2020 13:45<br>
<b>A:</b> Eugenio Trumpy <frippe12573@hotmail.com><br>
<b>Cc:</b> geonode-users <geonode-users@lists.osgeo.org><br>
<b>Oggetto:</b> Re: migration suggestions</font>
<div> </div>
</div>
<div class="" style="word-wrap:break-word; line-break:after-white-space">Hi Eugenio,
<div class=""><br class="">
</div>
<div class="">I would need to have a look what is going on. But yes local_settings should override settings.</div>
<div class="">The correct command for migrations is python manage.py migrate ... (instead of syncdb)</div>
<div class=""><br class="">
</div>
<div class="">best regards</div>
<div class=""><br class="">
</div>
<div class="">toni<br class="">
<div><br class="">
<blockquote type="cite" class="" style="margin-top: 0px; margin-bottom: 0px;">
<div class="">Am 20.03.2020 um 19:58 schrieb Eugenio Trumpy <<a href="mailto:frippe12573@hotmail.com" class="">frippe12573@hotmail.com</a>>:</div>
<br class="x_Apple-interchange-newline">
<div class="">
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif; font-size:12pt">
Dear Toni,</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif; font-size:12pt">
<br class="">
</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif; font-size:12pt">
I followed your hints.</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif; font-size:12pt">
I put the domain in the ALLOWED_HOSTS and now I visualise the home page.</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif; font-size:12pt">
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?</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif; font-size:12pt">
Then I modify local_setting.py to set credential to access geonode db.</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif; font-size:12pt">
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?</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif; font-size:12pt">
The geonode home page is visualised but I'm not able to enter with the old administrator credential.</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif; font-size:12pt">
I presume there is no connection with the db. Should I use again setting.py instead of local_setting.py?</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif; font-size:12pt">
<br class="">
</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif; font-size:12pt">
Thanks in advance,</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif; font-size:12pt">
<br class="">
</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif; font-size:12pt">
Eugenio</div>
<div class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<div id="x_appendonsend" class=""></div>
<div class="" style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt"><br class="">
</div>
<hr tabindex="-1" class="" style="display:inline-block; width:770.265625px">
<div id="x_divRplyFwdMsg" dir="ltr" class=""><font face="Calibri, sans-serif" class="" style="font-size:11pt"><b class="">Da:</b><span class="x_Apple-converted-space"> </span>Toni Schönbuchner <<a href="mailto:toni.schoenbuchner@csgis.de" class="">toni.schoenbuchner@csgis.de</a>><br class="">
<b class="">Inviato:</b><span class="x_Apple-converted-space"> </span>giovedì 19 marzo 2020 20:37<br class="">
<b class="">A:</b><span class="x_Apple-converted-space"> </span>Eugenio Trumpy <<a href="mailto:frippe12573@hotmail.com" class="">frippe12573@hotmail.com</a>><br class="">
<b class="">Cc:</b><span class="x_Apple-converted-space"> </span>geonode-users <<a href="mailto:geonode-users@lists.osgeo.org" class="">geonode-users@lists.osgeo.org</a>><br class="">
<b class="">Oggetto:</b><span class="x_Apple-converted-space"> </span>Re: migration suggestions</font>
<div class=""> </div>
</div>
<div class="x_BodyFragment"><font size="2" class=""><span class="" style="font-size:11pt">
<div class="x_PlainText">Dear Eugenio,<br class="">
<br class="">
<br class="">
> • 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?<br class="">
<br class="">
Allowed hosts is a security mechanism by Django to define Domains that serve your instance.<br class="">
<a href="https://docs.djangoproject.com/en/3.0/ref/settings/#allowed-hosts" class="">https://docs.djangoproject.com/en/3.0/ref/settings/#allowed-hosts</a><br class="">
<br class="">
To overcome an 504 error you can add something like<br class="">
<br class="">
ALLOWED_HOSTS = ['localhost' '127.0.0.1' 'your <a href="http://domain.com" class="">
domain.com</a>']<br class="">
<br class="">
to your settings.py or local_settings.p However, we all more and more avoid touching the settings file and try to configure everything<br class="">
with environment variables. So with a manual setup you can try to add it to your uwsgi config:<br class="">
<a href="https://docs.geonode.org/en/master/install/core/index.html#serving-geonode-geoserver-via-nginx" class="">https://docs.geonode.org/en/master/install/core/index.html#serving-geonode-geoserver-via-nginx</a><br class="">
<br class="">
> • 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.<br class="">
<br class="">
I'm unsure If I correctly understand. But the rough flow looks like:<br class="">
<br class="">
• Export your geonode 2.4 Database<br class="">
• Import it to a fresh Database<br class="">
• Be sure to correctly set permissions for your User<br class="">
• Change your settings.py for using the new database and in case the correct user<br class="">
• Fix some inconsistency within your new database. Run f.e. with pgadmin or by psql from console<br class="">
• ALTER TABLE public.layers_layer DROP COLUMN service_id<br class="">
• Run the migrations, this should update your database scheme from 2.4 to 2.10<br class="">
• DJANGO_SETTINGS_MODULE=YOURGEONODE.local_settings django python manage.py migrate --fake-initial<br class="">
<br class="">
You will need to change those commands to fit your setup further run into errors here and<br class="">
there but hopefully this steps help you to find out of the forest.<br class="">
<br class="">
Cheers,<br class="">
<br class="">
Toni<br class="">
<br class="">
<br class="">
-----------------------------------------------<br class="">
CSGIS<br class="">
<br class="">
-----------------------------------------------<br class="">
Spinnereistraße 7<br class="">
Halle 18 04179 Leipzig<br class="">
-----------------------------------------------<br class="">
Web <span class="x_Apple-converted-space"> </span><a href="https://csgis.de/" class="">https://csgis.de</a><br class="">
-----------------------------------------------<br class="">
<br class="">
Hinweis gemäß § 33 BDSG<br class="">
Daten der Verfahrensbeteiligten werden gespeichert. Dieses Dokument ist ausschließlich für den<span class="x_Apple-converted-space"> </span><br class="">
Adressaten bestimmt. Der Inhalt der E-Mail ist vertraulich. Falls Sie diese E-Mail versehentlich<span class="x_Apple-converted-space"> </span><br class="">
erhalten haben, rufen Sie uns unter obiger Rufnummer umgehend an und löschen Sie diese Nachricht<span class="x_Apple-converted-space"> </span><br class="">
von Ihrem Computer. Jegliche Art von Reproduktionen, Verbreitung, Vervielfältigung, Veränderung,<span class="x_Apple-converted-space"> </span><br class="">
Verteilung und/oder Veröffentlichung dieser E-Mail ist verboten.</div>
</span></font></div>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</body>
</html>