[GeoNetwork-users] Migration 322 fails when migrating from 3.0.5 to 3.4.0

Hi,

we tried to migrate our Geonetwork DB (PostgreSQL) from 3.0.5 to 3.4.0.
Because the auto migration on booting failed we tried to manually
migrate the DB using the migration scripts.
We succesfully executed the migrate-default.sql files
3.0.5->3.0.6 ok
3.0.6->3.1.0 ok
3.1.0->3.2.0 ok
3.2.0->3.2.1 ok
3.2.1->3.2.2 (/migrate/v322/migrate-default.sql) fails with
psql:/var/lib/tomcat/webapps/geonetwork/WEB-INF/classes/setup/sql/migrate/v322/migrate-default.sql:6:
ERROR: column "isenabled" of relation "users" does not exist
ZEILE 1: UPDATE users SET isenabled = 'y' WHERE enabled = true;
                          ^
psql:/var/lib/tomcat/webapps/geonetwork/WEB-INF/classes/setup/sql/migrate/v322/migrate-default.sql:7:
ERROR: column "isenabled" of relation "users" does not exist
ZEILE 1: UPDATE users SET isenabled = 'n' WHERE enabled = false;
                          ^
ALTER TABLE
psql:/var/lib/tomcat/webapps/geonetwork/WEB-INF/classes/setup/sql/migrate/v322/migrate-default.sql:12:
ERROR: column "enablecategoriesrestriction" of relation "groups" does
not exist
ZEILE 1: UPDATE groups SET enableCategoriesRestriction = 'y' WHERE EN...
                           ^
psql:/var/lib/tomcat/webapps/geonetwork/WEB-INF/classes/setup/sql/migrate/v322/migrate-default.sql:13:
ERROR: column "enablecategoriesrestriction" of relation "groups" does
not exist
ZEILE 1: UPDATE groups SET enableCategoriesRestriction = 'n' WHERE EN...

Did we miss any migration script that should have added the missing columns?

Anyway, we tried to go on with the following migration scripts and faced
more errors (some ma ybe following the first errors):

v323/migrate-default.sql ok
v330/migrate-default.sql fails with:

psql:/var/lib/tomcat/webapps/geonetwork/WEB-INF/classes/setup/sql/migrate/v330/migrate-default.sql:17:
ERROR: relation "selections" does not exist
ZEILE 1: INSERT INTO Selections (id, name, isWatchable) VALUES (0, 'P...
                     ^
psql:/var/lib/tomcat/webapps/geonetwork/WEB-INF/classes/setup/sql/migrate/v330/migrate-default.sql:18:
ERROR: relation "selections" does not exist
ZEILE 1: INSERT INTO Selections (id, name, isWatchable) VALUES (1, 'W...
                     ^
psql:/var/lib/tomcat/webapps/geonetwork/WEB-INF/classes/setup/sql/migrate/v330/migrate-default.sql:19:
ERROR: relation "selectionsdes" does not exist
ZEILE 1: INSERT INTO SelectionsDes (iddes, langid, label) VALUES (0,'...
                     ^
psql:/var/lib/tomcat/webapps/geonetwork/WEB-INF/classes/setup/sql/migrate/v330/migrate-default.sql:20:
ERROR: relation "selectionsdes" does not exist
ZEILE 1: INSERT INTO SelectionsDes (iddes, langid, label) VALUES (1,'...
                     ^
psql:/var/lib/tomcat/webapps/geonetwork/WEB-INF/classes/setup/sql/migrate/v330/migrate-default.sql:21:
ERROR: relation "selectionsdes" does not exist
ZEILE 1: INSERT INTO SelectionsDes (iddes, langid, label) VALUES (0,'...
                     ^
psql:/var/lib/tomcat/webapps/geonetwork/WEB-INF/classes/setup/sql/migrate/v330/migrate-default.sql:22:
ERROR: relation "selectionsdes" does not exist
ZEILE 1: INSERT INTO SelectionsDes (iddes, langid, label) VALUES (1,'...
                     ^
psql:/var/lib/tomcat/webapps/geonetwork/WEB-INF/classes/setup/sql/migrate/v330/migrate-default.sql:23:
ERROR: relation "selectionsdes" does not exist
ZEILE 1: INSERT INTO SelectionsDes (iddes, langid, label) VALUES (0,'...
                     ^
psql:/var/lib/tomcat/webapps/geonetwork/WEB-INF/classes/setup/sql/migrate/v330/migrate-default.sql:24:
ERROR: relation "selectionsdes" does not exist
ZEILE 1: INSERT INTO SelectionsDes (iddes, langid, label) VALUES (1,'...

Marco

--
Dr. Marco Lechner
Bundesamt fuer Strahlenschutz / Federal Office for Radiation Protection
SW2.1 Koordination Notfallschutzsysteme / Coordination Emergency Systems
Rosastrasse 9 | D-79098 Freiburg | Germany
mlechner@anonymised.com | +49 (0)3018 333 6724 | www.bfs.de

--
Hinweis zu Anhängen die auf .p7m/.p7c/.p7s oder .asc/.asc.sig enden:
Die .p7?- und .asc-Dateien sind ungefährliche Signaturdateien (digitale
Unterschriften).
In E-Mail-Clients mit S/MIME Konfiguration (.p7?) oder PGP-Erweiterung
(.asc) dienen sie zur:
- - Überprüfung des Absenders
- - Überprüfung einer evtl. Veränderung des Inhalts während der
Übermittlung über das Internet
Die Signaturdateien können ebenso dazu verwendet werden dem Absender
dieser Signatur eine E-Mail mit verschlüsseltem Inhalt zu senden.

In E-Mail-Clients ohne S/MIME Konfiguration oder PGP-Erweiterung
erscheinen die Dateien als Anhang und können ignoriert werden.

Hi Marco,

about the v322 migration, the is* columns should be created by hibernate when
geonetwork boots.
So, when the migration scripts are run by GN, the new columns should already
be there.
If you migrate by hand, the is*columns will be missing, so you'll get such
errors.
Please report the original errors that GN returns when the expected migration
is executed.

   Cheers,
   Emanuele

Alle 16:27:46 di Tuesday 30 January 2018, Dr. Marco Lechner ha scritto:

Hi,

we tried to migrate our Geonetwork DB (PostgreSQL) from 3.0.5 to 3.4.0.
Because the auto migration on booting failed we tried to manually
migrate the DB using the migration scripts.
We succesfully executed the migrate-default.sql files
3.0.5->3.0.6 ok
3.0.6->3.1.0 ok
3.1.0->3.2.0 ok
3.2.0->3.2.1 ok
3.2.1->3.2.2 (/migrate/v322/migrate-default.sql) fails with
psql:/var/lib/tomcat/webapps/geonetwork/WEB-INF/classes/setup/sql/migrate/v
322/migrate-default.sql:6: ERROR: column "isenabled" of relation "users"
does not exist
ZEILE 1: UPDATE users SET isenabled = 'y' WHERE enabled = true;
                          ^
psql:/var/lib/tomcat/webapps/geonetwork/WEB-INF/classes/setup/sql/migrate/v
322/migrate-default.sql:7: ERROR: column "isenabled" of relation "users"
does not exist
ZEILE 1: UPDATE users SET isenabled = 'n' WHERE enabled = false;
                          ^
ALTER TABLE
psql:/var/lib/tomcat/webapps/geonetwork/WEB-INF/classes/setup/sql/migrate/v
322/migrate-default.sql:12: ERROR: column "enablecategoriesrestriction" of
relation "groups" does not exist
ZEILE 1: UPDATE groups SET enableCategoriesRestriction = 'y' WHERE EN...
                           ^
psql:/var/lib/tomcat/webapps/geonetwork/WEB-INF/classes/setup/sql/migrate/v
322/migrate-default.sql:13: ERROR: column "enablecategoriesrestriction" of
relation "groups" does not exist
ZEILE 1: UPDATE groups SET enableCategoriesRestriction = 'n' WHERE EN...

Did we miss any migration script that should have added the missing
columns?

Anyway, we tried to go on with the following migration scripts and faced
more errors (some ma ybe following the first errors):

v323/migrate-default.sql ok
v330/migrate-default.sql fails with:

psql:/var/lib/tomcat/webapps/geonetwork/WEB-INF/classes/setup/sql/migrate/v
330/migrate-default.sql:17: ERROR: relation "selections" does not exist
ZEILE 1: INSERT INTO Selections (id, name, isWatchable) VALUES (0, 'P...
                     ^
psql:/var/lib/tomcat/webapps/geonetwork/WEB-INF/classes/setup/sql/migrate/v
330/migrate-default.sql:18: ERROR: relation "selections" does not exist
ZEILE 1: INSERT INTO Selections (id, name, isWatchable) VALUES (1, 'W...
                     ^
psql:/var/lib/tomcat/webapps/geonetwork/WEB-INF/classes/setup/sql/migrate/v
330/migrate-default.sql:19: ERROR: relation "selectionsdes" does not exist
ZEILE 1: INSERT INTO SelectionsDes (iddes, langid, label) VALUES (0,'...
                     ^
psql:/var/lib/tomcat/webapps/geonetwork/WEB-INF/classes/setup/sql/migrate/v
330/migrate-default.sql:20: ERROR: relation "selectionsdes" does not exist
ZEILE 1: INSERT INTO SelectionsDes (iddes, langid, label) VALUES (1,'...
                     ^
psql:/var/lib/tomcat/webapps/geonetwork/WEB-INF/classes/setup/sql/migrate/v
330/migrate-default.sql:21: ERROR: relation "selectionsdes" does not exist
ZEILE 1: INSERT INTO SelectionsDes (iddes, langid, label) VALUES (0,'...
                     ^
psql:/var/lib/tomcat/webapps/geonetwork/WEB-INF/classes/setup/sql/migrate/v
330/migrate-default.sql:22: ERROR: relation "selectionsdes" does not exist
ZEILE 1: INSERT INTO SelectionsDes (iddes, langid, label) VALUES (1,'...
                     ^
psql:/var/lib/tomcat/webapps/geonetwork/WEB-INF/classes/setup/sql/migrate/v
330/migrate-default.sql:23: ERROR: relation "selectionsdes" does not exist
ZEILE 1: INSERT INTO SelectionsDes (iddes, langid, label) VALUES (0,'...
                     ^
psql:/var/lib/tomcat/webapps/geonetwork/WEB-INF/classes/setup/sql/migrate/v
330/migrate-default.sql:24: ERROR: relation "selectionsdes" does not exist
ZEILE 1: INSERT INTO SelectionsDes (iddes, langid, label) VALUES (1,'...

Marco

--

Regards,
Emanuele Tajariol

GeoServer Professional Services from the experts! Visit http://goo.gl/it488V
for more information.

Ing. Emanuele Tajariol
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------
AVVERTENZE AI SENSI DEL D.Lgs. 196/2003
Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i
file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo
è consentito esclusivamente al destinatario del messaggio, per le finalità
indicate nel messaggio stesso. Qualora riceviate questo messaggio senza
esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-
mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal
Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte,
distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse,
costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the
attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act (Legislative
Decree June, 30 2003, no.196 - Italy's New Data Protection Code).Any use not
in accord with its purpose, any disclosure, reproduction, copying,
distribution, or either dissemination, either whole or partial, is strictly
forbidden except previous formal approval of the named addressee(s). If you
are not the intended recipient, please contact immediately the sender by
telephone, fax or e-mail and delete the information in this message that has
been received in error. The sender does not give any warranty or accept
liability as the content, accuracy or completeness of sent messages and
accepts no responsibility for changes made after they were sent or for other
risks which arise as a result of e-mail transmission, viruses, etc.