<div dir="ltr"><div dir="ltr"><div>Hi Toni,</div><div><br></div><div>Thanks for the link, I somehow missed your issue when searching... I had the same issue than you at <span style="font-family:monospace,monospace">layers.0029_layer_service</span></div><div><br></div><div>For reference, here's the procedure I used to successfully complete the migrations : <a href="https://github.com/olivierdalang/SPCgeonode#how-to-migrate-from-an-existing-standard-geonode-install">https://github.com/olivierdalang/SPCgeonode#how-to-migrate-from-an-existing-standard-geonode-install</a> (specific to SPCgeonode but can be transposed).</div><div><br></div><div>Cheers,</div><div><br></div><div>Olivier<br></div><div><br></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Oct 18, 2018 at 6:26 PM Toni Schönbuchner <<a href="mailto:toni.schoenbuchner@csgis.de">toni.schoenbuchner@csgis.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><div>Hi Olivier,</div><div><br></div><div>I´ve migrated 2.4 -> 2.8 some time ago and found problems with db migrations as well.</div><div>See Issue: <a href="https://github.com/GeoNode/geonode/issues/3870" target="_blank">https://github.com/GeoNode/geonode/issues/3870</a></div><div>Did you go to 2.10? And can you share your errortrace somewhere?</div><div><br></div><div><br></div><div>Chees,</div><div><br></div><div>Toni</div><div><br><blockquote type="cite"><div><div>Today's Topics:<br><br>   1. Migration from 2.4 (Olivier Dalang)<br><br><br>----------------------------------------------------------------------<br><br>Message: 1<br>Date: Thu, 18 Oct 2018 13:34:29 +1200<br>From: Olivier Dalang <<a href="mailto:olivier.dalang@gmail.com" target="_blank">olivier.dalang@gmail.com</a>><br>To: geonode-users <<a href="mailto:geonode-users@lists.osgeo.org" target="_blank">geonode-users@lists.osgeo.org</a>><br>Subject: [GeoNode-users] Migration from 2.4<br>Message-ID:<br><span class="m_-7669860131380666627Apple-tab-span" style="white-space:pre-wrap">        </span><<a href="mailto:CAExk7p3RqhCDCg2B6cz0ZMSQigFuv5WxrsEkjZjFCGwULdUwpA@mail.gmail.com" target="_blank">CAExk7p3RqhCDCg2B6cz0ZMSQigFuv5WxrsEkjZjFCGwULdUwpA@mail.gmail.com</a>><br>Content-Type: text/plain; charset="utf-8"<br><br>Hi !<br><br>I'm currently trying to migrate an old geonode install (2.4) to the current<br>version.<br>I managed to get the migrations to run after some tweaks (details below),<br>but the database is not consistent with the models.<br><br>Is this expected ? Or is there something wrong with the previous install ?<br>(it's old and I have no details about how it was installed). I searched a<br>bit about migrating old geonodes, but didn't find any details past<br>migrating with --fake-initial.<br><br>I can fix the schema with sqldiff (from django-extensions) but would like<br>to know if this is supposed to happen or not.<br><br>Thanks !!<br><br>Olivier<br><br><br><br>Here are the steps I did :<br><br>1) Run migrations with --fake-initial. This fails at :<br><br>Applying layers.0029_layer_service...<br>...<br>django.db.utils.ProgrammingError: column "service_id" of relation<br>"layers_layer" already exists<br><br>2) Manually fix this :<br>ALTER TABLE public.layers_layer DROP COLUMN service_id;<br><br>3) Run the migrations (they complete)<br><br>4) Check the consistency with python manage.py sqldiff -ae (from<br>django-extensions). There are inconsistencies, some of which will cause<br>problems (NOT NULL constraints, missing columns, etc.). Using this, I can<br>fix the schema (need to drop tables with no models).<br><br>BEGIN;<br>-- Model missing for table: account_accountdeletion<br>-- Model missing for table: account_account<br>-- Model missing for table: account_signupcoderesult<br>-- Model missing for table: account_signupcode<br>-- Model missing for table: celery_taskmeta<br>-- Model missing for table: celery_tasksetmeta<br>-- Model missing for table: djcelery_intervalschedule<br>-- Model missing for table: djcelery_crontabschedule<br>-- Model missing for table: djcelery_periodictasks<br>-- Model missing for table: djcelery_workerstate<br>-- Model missing for table: account_signupcodeextended<br>-- Model missing for table: djcelery_periodictask<br>-- Model missing for table: djcelery_taskstate<br>-- Application: actstream<br>-- Model: Follow<br>CREATE INDEX "actstream_follow_object_id"<br>ON "actstream_follow" ("object_id");<br>CREATE INDEX "actstream_follow_object_id_like"<br>ON "actstream_follow" ("object_id" varchar_pattern_ops);<br>CREATE INDEX "actstream_follow_started"<br>ON "actstream_follow" ("started");<br>-- Model: Action<br>CREATE INDEX "actstream_action_actor_object_id"<br>ON "actstream_action" ("actor_object_id");<br>CREATE INDEX "actstream_action_actor_object_id_like"<br>ON "actstream_action" ("actor_object_id" varchar_pattern_ops);<br>CREATE INDEX "actstream_action_verb"<br>ON "actstream_action" ("verb");<br>CREATE INDEX "actstream_action_verb_like"<br>ON "actstream_action" ("verb" varchar_pattern_ops);<br>CREATE INDEX "actstream_action_target_object_id"<br>ON "actstream_action" ("target_object_id");<br>CREATE INDEX "actstream_action_target_object_id_like"<br>ON "actstream_action" ("target_object_id" varchar_pattern_ops);<br>CREATE INDEX "actstream_action_action_object_object_id"<br>ON "actstream_action" ("action_object_object_id");<br>CREATE INDEX "actstream_action_action_object_object_id_like"<br>ON "actstream_action" ("action_object_object_id" varchar_pattern_ops);<br>CREATE INDEX "actstream_action_timestamp"<br>ON "actstream_action" ("timestamp");<br>CREATE INDEX "actstream_action_public"<br>ON "actstream_action" ("public");<br>ALTER TABLE "actstream_action"<br>ALTER "data" TYPE jsonb;<br>-- Application: tastypie<br>-- Model: ApiKey<br>ALTER TABLE "tastypie_apikey"<br>ALTER "key" TYPE varchar(128);<br>-- Application: base<br>-- Model: ContactRole<br>ALTER TABLE "base_contactrole"<br>ALTER COLUMN "resource_id" DROP NOT NULL;<br>-- Model: ResourceBase<br>ALTER TABLE "base_resourcebase"<br>DROP COLUMN "distribution_url";<br>ALTER TABLE "base_resourcebase"<br>DROP COLUMN "distribution_description";<br>-- Model: Link<br>ALTER TABLE "base_link"<br>ALTER COLUMN "resource_id" DROP NOT NULL;<br>-- Application: layers<br>-- Model: Layer<br>ALTER TABLE "layers_layer"<br>DROP COLUMN "distribution_description_en";<br>-- Application: maps<br>-- Model: Map<br>ALTER TABLE "maps_map"<br>DROP COLUMN "distribution_description_en";<br>-- Application: documents<br>-- Model: Document<br>ALTER TABLE "documents_document"<br>DROP COLUMN "distribution_description_en";<br>ALTER TABLE "documents_document"<br>ALTER "doc_file" TYPE varchar(255);<br>ALTER TABLE "documents_document"<br>ALTER "doc_url" TYPE varchar(255);<br>-- Application: people<br>-- Model: Profile<br>ALTER TABLE "people_profile"<br>ALTER "email" TYPE varchar(254);<br>ALTER TABLE "people_profile"<br>ALTER COLUMN "last_login" DROP NOT NULL;<br>-- Application: groups<br>-- Model: GroupProfile<br>ALTER TABLE "groups_groupprofile"<br>ALTER "email" TYPE varchar(254);<br>-- Application: upload<br>-- Model: Upload<br>ALTER TABLE "upload_upload"<br>ADD COLUMN "mosaic_time_value" varchar(128);<br>ALTER TABLE "upload_upload"<br>ADD COLUMN "mosaic_time_regex" varchar(128);<br>ALTER TABLE "upload_upload"<br>ADD COLUMN "mosaic_elev_regex" varchar(128);<br>ALTER TABLE "upload_upload"<br>ADD COLUMN "mosaic_elev_value" varchar(128);<br>COMMIT;<br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: <<a href="http://lists.osgeo.org/pipermail/geonode-users/attachments/20181018/e836c8ca/attachment.html" target="_blank">http://lists.osgeo.org/pipermail/geonode-users/attachments/20181018/e836c8ca/attachment.html</a>><br><br>------------------------------<br><br>Subject: Digest Footer<br><br>_______________________________________________<br>geonode-users mailing list<br><a href="mailto:geonode-users@lists.osgeo.org" target="_blank">geonode-users@lists.osgeo.org</a><br><a href="https://lists.osgeo.org/mailman/listinfo/geonode-users" target="_blank">https://lists.osgeo.org/mailman/listinfo/geonode-users</a><br><br><br>------------------------------<br><br>End of geonode-users Digest, Vol 45, Issue 69<br>*********************************************<br></div></div></blockquote></div><br></div></blockquote></div>