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