Database migrate from DSpace 6 to DSpace 7.4

218 views
Skip to first unread message

ZiGi

unread,
Dec 5, 2022, 7:39:47 AM12/5/22
to DSpace Technical Support
Dear all,
I have big problem with migrating database from DSpace 6 to Dspace 7.4. When I try use command ./dspace migrate ignored I have very long error which you can see in the attachment. So after use command dspace database info i got result which you find in attachment. After that I tried this solution: https://groups.google.com/g/dspace-tech/c/enhTBvnQm68/m/WnEgFm2-AwAJ but in my schema_version I didn't have script named V5.7_2017.04.11__DS-3563_Index_metadatavalue_resource_type_id_column.sql, everyone else had status "t" so I did everything in this solution: https://groups.google.com/g/dspace-tech/c/enhTBvnQm68/m/HM_kefBVDAAJ but after use command dspace database migrate ingnored I still have error telling about SQL errors. So far I tried also upgrade DSPace 6 to 7.4 with the same result. I really don't know what else I can do.
Thanks,
Dominik 
dspace_database_info.jpgpsql_script_success.jpg

dspace_database_migrate_ignored.txt

Seun Adewoye

unread,
Dec 5, 2022, 8:10:46 AM12/5/22
to DSpace Technical Support
I am currently having the same issues. DSpace 6 database upgrade to 7.4 seems not working. Any help will be appreciated.

Tim Donohue

unread,
Dec 5, 2022, 10:44:15 AM12/5/22
to ZiGi, DSpace Technical Support
Hi,

This database migration error is one that some sites have encountered after accidentally not running the "V5_7_2017_05_05__DS_3431_Add_Policies_for_BasicWorkflow" migration during an older 5.x -> 6.x upgrade.   See this email thread: https://groups.google.com/g/dspace-tech/c/F6ztOrBjXBA/m/fe3UP0_KAgAJ

Luckily, this older migration is no longer valid.... so, if you haven't run it already, it can now be skipped entirely (as it was only necessary for DSpace 6.x and is not valid for DSpace 7.x)

Unfortunately, at this time, skipping this script can only be done directly in your database as follows:
  1. In your database, you'll need to modify the Flyway "schema_version" table for that specific migration.
  2. Look for the entry in that table for "V5.7.2017.05.05" (notice how this matches with the name of the migration script above) and set its "success" column to "t" (true)
  3. Run "./dspace database info" to verify that script is no longer showing a State of "Ignored" (it should now say either "Success" or "Out of Order". Either status means it'll no longer be run.)
  4. Try that "./dspace database migrate ignored" script again.  Hopefully it'll work this time!

Let us know if this works for you by responding on this mailing list.

Tim

From: dspac...@googlegroups.com <dspac...@googlegroups.com> on behalf of ZiGi <domi...@wp.pl>
Sent: Monday, December 5, 2022 2:58 AM
To: DSpace Technical Support <dspac...@googlegroups.com>
Subject: [dspace-tech] Database migrate from DSpace 6 to DSpace 7.4
 
--
All messages to this mailing list should adhere to the Code of Conduct: https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
---
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/3e40c5ca-7b91-4f59-a79c-52f9a9f4de70n%40googlegroups.com.

ZiGi

unread,
Dec 6, 2022, 4:31:20 AM12/6/22
to DSpace Technical Support
Hi,
I'm not sure you check the attachment in my first e-mail but I done everything one more time. So I don't have anything like  "V5.7.2017.05.05" or 
"V5_7_2017_05_05__DS_3431_Add_Policies_for_BasicWorkflow" on my schema_version, you can check that on screenshot in attachment but if I run ./dspace database info there is  "V5_7_2017_05_05__DS_3431_Add_Policies_for_BasicWorkflow" with status "Ignored". Any help will be  appreciated.
 Thanks,
Dominik
error.jpg
database_info.jpg
schema_version.jpg

ZiGi

unread,
Dec 6, 2022, 6:31:40 AM12/6/22
to DSpace Technical Support
Dear Tim,
Maybe you could send me the full query which I could use to insert missing row? Becouse as I said I don't have  anything like  "V5.7.2017.05.05" or 
"V5_7_2017_05_05__DS_3431_Add_Policies_for_BasicWorkflow" on my schema_version.
Thanks,
Dominik

ZiGi

unread,
Dec 6, 2022, 7:37:58 AM12/6/22
to DSpace Technical Support
Nevermind,
I SOLVED this problem by adding two rows to schema_version in dspace database:

INSERT INTO schema_version (installed_rank,version,description,type,script,checksum,installed_by,installed_on,execution_time,success) values (27,'5.7.2017.04.11','DS-3563 Index metadatavalue resource type id column','SQL','V5.7_2017.04.11__DS-3563_Index_metadatavalue_resource_type_id_column.sql',-1,'dspace','2022-12-06 12:32:09.793369',0,true);

INSERT INTO schema_version (installed_rank,version,description,type,script,checksum,installed_by,installed_on,execution_time,success) values (29,'5.7.2017.05.05','DS 3431 Add Policies for BasicWorkflow','JDBC','DS 3431 Add Policies for BasicWorkflow',-1,'dspace','2022-12-06 12:32:09.793369',0,true);

after that, run command  ./dspace database repair and then  ./dspace database migrate ignored . In my case everythig works now.
Dominik

Seun Adewoye

unread,
Dec 6, 2022, 8:44:09 AM12/6/22
to ZiGi, DSpace Technical Support
Hi Dominik, when i ran the query above I got this error

ERROR:  duplicate key value violates unique constraint "schema_version_pk"
DETAIL:  Key (installed_rank)=(27) already exists.

ERROR:  duplicate key value violates unique constraint "schema_version_pk"
DETAIL:  Key (installed_rank)=(29) already exists.

Please am I missing something?

You received this message because you are subscribed to a topic in the Google Groups "DSpace Technical Support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dspace-tech/PlOA1WMvd4M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dspace-tech...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/cd0a353f-b463-4d58-8f71-375ba871a1cdn%40googlegroups.com.


--
Adewoye Seun Oyebanji
RHCE | MCITP | R.ENG | MNSE
banjia...@gmail.com, banjia...@live.com,
+2347062930768

 I can do all things through Christ who strengthens me

ZiGi

unread,
Dec 6, 2022, 9:48:05 AM12/6/22
to DSpace Technical Support
Hi,
Just use command: select installed_rank from schema_version; check which number is the highest and use one bigger in query.
For example: the biggest number on installed_rank is 32 so your query should looks like this:
 
INSERT INTO schema_version (installed_rank,version,description,type,script,checksum,installed_by,installed_on,execution_time,success) values (33,'5.7.2017.04.11','DS-3563 Index metadatavalue resource type id column','SQL','V5.7_2017.04.11__DS-3563_Index_metadatavalue_resource_type_id_column.sql',-1,'dspace','2022-12-06 12:32:09.793369',0,true);

INSERT INTO schema_version (installed_rank,version,description,type,script,checksum,installed_by,installed_on,execution_time,success) values (34,'5.7.2017.05.05','DS 3431 Add Policies for BasicWorkflow','JDBC','DS 3431 Add Policies for BasicWorkflow',-1,'dspace','2022-12-06 12:32:09.793369',0,true);

Seun Adewoye

unread,
Dec 6, 2022, 10:55:44 AM12/6/22
to ZiGi, DSpace Technical Support
Thank you so much Dominik, it worked. 

Tim Donohue

unread,
Dec 14, 2022, 10:54:03 AM12/14/22
to DSpace Technical Support
All,

Just to follow-up on this thread, as several users have hit these same issues in the upgrade from 6.x -> 7.x, I'm working on creating an new "./dspace database skip" command which allows you to easily *skip* failing/problematic (older) migrations. I'm hoping this new command will be available in the upcoming 7.5 release (due in Feb). The early code is at https://github.com/DSpace/DSpace/pull/8611 (and testers are welcome if this is of interest to you).

This new "skip" command will just be an easier way to run the INSERT command(s) that Dominik suggested earlier in this thread.  In the meantime, those INSERT commands are the easiest way to solve this issue. Thanks to Dominik for figuring out the correct solution.

Tim

Tim Donohue

unread,
Jan 11, 2023, 12:56:50 PM1/11/23
to DSpace Technical Support
All,

Just to follow up on this thread, as of today the new "./dspace database skip" command has been added to the codebase.  It will be available in 7.5 (due in Feb).   See https://github.com/DSpace/DSpace/pull/8611

In the meantime, those INSERT commands (documented by Dominik in this email thread) are the easiest way to solve this issue for any institutions who encounter this problem in 7.4 or below.  (The new "skip" command runs those same INSERT commands in an easier fashion)

Tim
Reply all
Reply to author
Forward
0 new messages