<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div style="padding-bottom: 10px; padding-top: 5px;">
<div style="padding:12px; border:1px solid #8D3970; background-color:#F7F9FA; color:#8D3970; font-size:14px; line-height:22px; font-family: Calibri, Arial, Helvetica, sans-serif;">
<strong>CAUTION:</strong> This e-mail originated outside the University of Southampton.
</div>
</div>
<div>
<div dir="ltr">David, thanks for advice. This removed most errors related to foreign key constraints. Just one remained:
<div><br>
</div>
<div>Upgrading rindex and grep tables for subject<br>
DBD::mysql::db do failed: Error on rename of './scireldiaprints/#sql-10710_48' to './scireldiaprints/subject__rindex' (errno: 150) at /usr/share/eprints/bin/../perl_lib/EPrints/Database.pm line 3052, &lt;STDIN&gt; line 1.<br>
SQL ERROR (do): ALTER IGNORE TABLE subject__rindex MODIFY field VARCHAR(64) CHARACTER SET UTF8, MODIFY word VARCHAR(128) CHARACTER SET UTF8, DEFAULT CHARACTER SET UTF8, DROP PRIMARY KEY, ADD PRIMARY KEY(field,word,`subjectid`), DROP KEY `subject__rindex_subjectid_2`<br>
SQL ERROR (do): Error on rename of './scireldiaprints/#sql-10710_48' to './scireldiaprints/subject__rindex' (errno: 150) (#1025)<br>
</div>
<div><br>
</div>
<div>However, the main problem that stops upgrade script remains:</div>
<div><br>
</div>
<div>Upgrading dataset metafield<br>
<br>
------------------------------------------------------------------<br>
---------------- EPrints System Error ----------------------------<br>
------------------------------------------------------------------<br>
An unexpected error occurred while attempting to convert tables to UTF-8.<br>
<br>
------------------------------------------------------------------<br>
EPrints System Error inducing stack dump<br>
&nbsp;at /usr/share/eprints/bin/../perl_lib/EPrints.pm line 147, &lt;STDIN&gt; line 1.<br>
&nbsp; &nbsp; &nbsp; &nbsp; EPrints::abort() called at /usr/share/eprints/bin/epadmin line 2753<br>
&nbsp; &nbsp; &nbsp; &nbsp; main::upgrade_mysql_charset('EPrints::Repository=HASH(0x13dec90)', 'EPrints::Database::mysql=HASH(0x408a3b8)') called at /usr/share/eprints/bin/epadmin line 3008<br>
&nbsp; &nbsp; &nbsp; &nbsp; main::upgrade_3_1_2_to_3_2_0('EPrints::Repository=HASH(0x13dec90)', 'EPrints::Database::mysql=HASH(0x408a3b8)') called at /usr/share/eprints/bin/epadmin line 2887<br>
&nbsp; &nbsp; &nbsp; &nbsp; main::upgrade('scireldiaprints') called at /usr/share/eprints/bin/epadmin line 320<br>
</div>
<div><br>
</div>
<div>And, yes. This is very old version of ePrints (3.1.3) as well as underlaying MySQL version (4.1.22). Now I am researching upgrade path to ePrints 3.4.2 on MariaDB 5.5.68.</div>
<div><br>
</div>
<div>Guntis</div>
<div><br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Sat, Jan 16, 2021 at 8:37 PM David R Newman &lt;<a href="mailto:drn@ecs.soton.ac.uk">drn@ecs.soton.ac.uk</a>&gt; wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<p>Hi Guntis,</p>
<p>This looks to be down to foreign key constraints.&nbsp; As you are trying to upgrade from a version of EPrints that is over 12 years ago, I cannot know whether this was a known issue at the time or just some quirk of running an very old EPrints database schema
 in what may be a rather more recent version of MySQL.&nbsp; <br>
</p>
<p>Assuming that you have suitables backups of the database so you can roll back if things go wrong, I would recommend temporarily adding the following line to perl_lib/EPrints/Database/<a href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmysql.pm%2F&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cb12b7395c8804efcc67c08d8bafdf25b%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637464947146251716%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=BEK5x0h2IqwK2iIGy401O1ttErRpXJ6hf%2BAXatX3HK0%3D&amp;reserved=0" originalSrc="http://mysql.pm/" shash="zsYZNmYpMsuY83tpS8Pr73YV6s7946/QpAoyyqgK9n+yqnHqKvP2HQXQTofh5JiFEDIb/VMVL9Fjc4ObHsY8Fz8O3kvqIjqSfn6K7ixLrw6biTJsok/rj6+8h06tuVnzHcjWB5cfZm1aR4e+kM0bWYzxEF+Cib8E5y7Ft75T8Js=" target="_blank">mysql.pm</a> (for EPrints 3.3.16)
 after line 243:</p>
<pre><code><span>                $self-&gt;do('SET</span> foreign_key_checks = <span>0</span>;');
</code></pre>
<div>This should allow you to run the upgrade script without getting any errors like you previously reported.&nbsp; However, once you have hopefully run epadmin upgrade successfully you should immediately remove this line from
<a href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmysql.pm%2F&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cb12b7395c8804efcc67c08d8bafdf25b%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637464947146261701%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=7Kark2J7vua3QoHYdc9CtnfEUKcgtWC8Uf7ZhZ0dkCA%3D&amp;reserved=0" originalSrc="http://mysql.pm/" shash="CePYJ7+u+gWgjhqCgGvDwafdZu0tj6EyAKHIs4B8AvYUCw+twoaqCax9IWZQP2VyJwssprnbjGXBXYBxeH6jOO/0vxRv8SSvwd/C+h05eNfIHKt7Txqxq4nAmsf3zurMV1HuP3P19j0JO8vrATI+7ejUcLO5fGdO7SJ0VNWpvis=" target="_blank">mysql.pm</a>.&nbsp; This temporary change should allow the upgrade script to tinker with the database schema without having to worry about foreign keys constraints being temporarily broken.&nbsp; Hopefully, by the time it finishes
 the database schema will be fully upgraded but there will not be any foreign key constraint issues still present.<br>
</div>
<div><br>
</div>
<div>I am not sure whether the issues you had from you first run of &quot;epadmin upgrade&quot; will have left the database in an inconsistent state, so it may be worth restoring the database from a backup be re-running &quot;epadmin upgrade&quot; with the change I have suggested
 to <a href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmysql.pm%2F&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cb12b7395c8804efcc67c08d8bafdf25b%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637464947146261701%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=7Kark2J7vua3QoHYdc9CtnfEUKcgtWC8Uf7ZhZ0dkCA%3D&amp;reserved=0" originalSrc="http://mysql.pm/" shash="CePYJ7+u+gWgjhqCgGvDwafdZu0tj6EyAKHIs4B8AvYUCw+twoaqCax9IWZQP2VyJwssprnbjGXBXYBxeH6jOO/0vxRv8SSvwd/C+h05eNfIHKt7Txqxq4nAmsf3zurMV1HuP3P19j0JO8vrATI+7ejUcLO5fGdO7SJ0VNWpvis=" target="_blank">mysql.pm</a>.</div>
<div><br>
</div>
<div>Let me know how it goes.&nbsp; I may be able to help if you still have problems but I have really much worked with EPrints prior to 3.2.&nbsp; There may be some veterans on the list that may know more about known issues upgrading from 3.1.x to 3.3.</div>
<div><br>
</div>
<div>Regards</div>
<div><br>
</div>
<div>David Newman<br>
</div>
<div><br>
</div>
<div>On 16/01/2021 18:01, Guntis Zelvis via Eprints-tech wrote:<br>
</div>
<blockquote type="cite">
<pre>CAUTION: This e-mail originated outside the University of Southampton.

Hello! I am trying to migrate EPrints v3.1.2 to the latest version. As
I understand it is impossible to migrate straight to v3.4.2, so first
I try to install v3.3.16 and upgrade repository to this version, but
there is few errors in output of 'epadmin upgrade REPOID'

Added dataset upload_progress
DBD::mysql::db do failed: Can't create table 'REPOID.#sql-10710_38'
(errno: 150) at /usr/share/eprints/bin/../perl_lib/EPrints/Database.pm
line 3052, &lt;STDIN&gt; line 1.
SQL ERROR (do): ALTER TABLE `subject_name_sortvalue` ADD CONSTRAINT
`subject_name_sortvalue_fk` FOREIGN KEY(`subjectid`) REFERENCES
`subject`(`subjectid`) ON DELETE CASCADE
SQL ERROR (do): Can't create table 'REPOID.#sql-10710_38' (errno: 150) (#1005)

Later there is:

Upgrading dataset file
Upgrading `file` by insertion
DBD::mysql::db do failed: Cannot delete or update a parent row: a
foreign key constraint fails at
/usr/share/eprints/bin/../perl_lib/EPrints/Database.pm line 3052,
&lt;STDIN&gt; line 1.
SQL ERROR (do): DROP TABLE IF EXISTS `old_file`
SQL ERROR (do): Cannot delete or update a parent row: a foreign key
constraint fails (#1217)

Upgrading dataset upload_progress
Upgrading `upload_progress` by insertion
DBD::mysql::db do failed: Cannot delete or update a parent row: a
foreign key constraint fails at
/usr/share/eprints/bin/../perl_lib/EPrints/Database.pm line 3052,
&lt;STDIN&gt; line 1.
SQL ERROR (do): DROP TABLE IF EXISTS `old_upload_progress`
SQL ERROR (do): Cannot delete or update a parent row: a foreign key
constraint fails (#1217)

Upgrading rindex and grep tables for subject
DBD::mysql::st execute failed: Table 'REPOID.subject__rindex' doesn't
exist at /usr/share/eprints/perl_lib/EPrints/Database/<a href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmysql.pm%2F&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cb12b7395c8804efcc67c08d8bafdf25b%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637464947146271696%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=ej67qUinzpvodrVxJEbh8O6ZdMd6doxthl1AIIlK%2Fsc%3D&amp;reserved=0" originalSrc="http://mysql.pm/" shash="X7A1xKMZBtVMI7VCExhJfrJLaU0TQ3kUkgY+pUSn+6sFqyqUa5zmeK+4xnus4OKpgRd2aV+Ty4Tr7gFz/93wXPcI6QMAbe6EVMIAFbykiYqOMOgU/Efym41L0136ZOeDAFsWPgGE/KQFuG/aQ9pyKeWobiy6NZry/tsNdZUm52E=" target="_blank">mysql.pm</a> line
423, &lt;STDIN&gt; line 1.
DBD::mysql::st fetch failed: fetch() without execute() at
/usr/share/eprints/perl_lib/EPrints/Database/<a href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmysql.pm%2F&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cb12b7395c8804efcc67c08d8bafdf25b%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637464947146271696%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=ej67qUinzpvodrVxJEbh8O6ZdMd6doxthl1AIIlK%2Fsc%3D&amp;reserved=0" originalSrc="http://mysql.pm/" shash="X7A1xKMZBtVMI7VCExhJfrJLaU0TQ3kUkgY+pUSn+6sFqyqUa5zmeK+4xnus4OKpgRd2aV+Ty4Tr7gFz/93wXPcI6QMAbe6EVMIAFbykiYqOMOgU/Efym41L0136ZOeDAFsWPgGE/KQFuG/aQ9pyKeWobiy6NZry/tsNdZUm52E=" target="_blank">mysql.pm</a> line 426,
&lt;STDIN&gt; line 1.
DBD::mysql::st execute failed: Table 'REPOID.subject__rindex' doesn't
exist at /usr/share/eprints/bin/epadmin line 2769, &lt;STDIN&gt; line 1.
DBD::mysql::st fetch failed: fetch() without execute() at
/usr/share/eprints/bin/epadmin line 2770, &lt;STDIN&gt; line 1.
DBD::mysql::db do failed: Table 'REPOID.subject__rindex' doesn't exist
at /usr/share/eprints/bin/../perl_lib/EPrints/Database.pm line 3052,
&lt;STDIN&gt; line 1.
SQL ERROR (do): ALTER IGNORE TABLE subject__rindex MODIFY field
VARCHAR(64) CHARACTER SET UTF8, MODIFY word VARCHAR(128) CHARACTER SET
UTF8, DEFAULT CHARACTER SET UTF8, ADD PRIMARY
KEY(field,word,`subjectid`)
SQL ERROR (do): Table 'REPOID.subject__rindex' doesn't exist (#1146)

And everything stops here:
Upgrading dataset metafield

------------------------------------------------------------------
---------------- EPrints System Error ----------------------------
------------------------------------------------------------------
An unexpected error occurred while attempting to convert tables to UTF-8.

------------------------------------------------------------------
EPrints System Error inducing stack dump
 at /usr/share/eprints/bin/../perl_lib/EPrints.pm line 147, &lt;STDIN&gt; line 1.
        EPrints::abort() called at /usr/share/eprints/bin/epadmin line 2753
        main::upgrade_mysql_charset('EPrints::Repository=HASH(0xb9fc80)',
'EPrints::Database::mysql=HASH(0x384b458)') called at
/usr/share/eprints/bin/epadmin line 3008
        main::upgrade_3_1_2_to_3_2_0('EPrints::Repository=HASH(0xb9fc80)',
'EPrints::Database::mysql=HASH(0x384b458)') called at
/usr/share/eprints/bin/epadmin line 2887
        main::upgrade('REPOID') called at
/usr/share/eprints/bin/epadmin line 320

How to fix these errors and complete repository upgrade?

*** Options: <a href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech" target="_blank">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a>
*** Archive: <a href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cb12b7395c8804efcc67c08d8bafdf25b%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637464947146281691%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=%2FRVIy7QPbehTU1UUjMIxEc6%2F062tY6HW4Oe0HeugzTs%3D&amp;reserved=0" originalSrc="http://www.eprints.org/tech.php/" shash="bwWsX8M3DdoCOrhrxAR2JPZmFah/2vcHQGq9UpFCeHk+/NTrNA8hVwO9nCmt0nY6/yL2VUExMZ16TMkaqAim2wX8X/HD1il7EjMf6PUY65uNRNzxF+E3BHcXBfjNR1gE0uaJqJm3o3U0a/sD6X4036pneF/pEjYftMpl0o0SQlw=" target="_blank">https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;amp;data=04%7C01%7Cdrn%40ecs.soton.ac.uk%7C80641a7b0bb64e32af1808d8ba494561%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637464171151379183%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;amp;sdata=HhJbYby71iR6yf1Dz2kJu5kBgLpM%2BSxmur8JA5VV75Q%3D&amp;amp;reserved=0</a>
*** EPrints community wiki: <a href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cb12b7395c8804efcc67c08d8bafdf25b%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637464947146281691%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=FBb7FYwIe4LExZjOVg3j%2BHHlJFeLkIfk85kd9om8D4w%3D&amp;reserved=0" originalSrc="http://wiki.eprints.org/" shash="QAF5fceIsmV0NSS94uCotBCNvZ51+vv0J0T13/K80RGkc0owyGpZMyfhp5NJnvVxo1/vyCykFjqVKrKrcyCRgNbKnPbr/9lZ8ohzCyN9sf/s5ZEQSqbfd34s9f17nhNPS/qaXD6hl1IGr+F9ZdvOTCGzoQwhxAcqefpzAuwFz6U=" target="_blank">https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;amp;data=04%7C01%7Cdrn%40ecs.soton.ac.uk%7C80641a7b0bb64e32af1808d8ba494561%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637464171151379183%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;amp;sdata=RrZj2YwOClqbT8Q8Act3TtVAUim5cof4MzIVMxtHyLo%3D&amp;amp;reserved=0</a>
</pre>
</blockquote>
<div id="gmail-m_-6312468162313403187DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br>
<table style="border-top:1px solid rgb(211,212,222)">
<tbody>
<tr>
<td style="width:55px;padding-top:13px"><a href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.avg.com%2Femail-signature%3Futm_medium%3Demail%26utm_source%3Dlink%26utm_campaign%3Dsig-email%26utm_content%3Demailclient&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cb12b7395c8804efcc67c08d8bafdf25b%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637464947146291685%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=CHjOlQKO8loahM67OgRLX6UZ9%2FAHhzY4A%2BqYW%2BNBeXU%3D&amp;reserved=0" originalSrc="http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" shash="S58dWY8TeiEBzl8tfK2nqevTObXsf6EZhhQEKZ2EZD9JpfBayYAQ30GObCyYYNIeTgSpknPhU0YmNYyJtopYBJ8ox46wdKrnz7QhGrON4kwLjkGanTwijkVUU6liFczWChOF1gcctv/W/kcAfdRGh3n69gky+jF/SO52IGFBJRM=" target="_blank"><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-green-avg-v1.png" alt="" width="46" height="29" style="width: 46px; height: 29px;"></a></td>
<td style="width:470px;padding-top:12px;color:rgb(65,66,78);font-size:13px;font-family:Arial,Helvetica,sans-serif;line-height:18px">
Virus-free. <a href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.avg.com%2Femail-signature%3Futm_medium%3Demail%26utm_source%3Dlink%26utm_campaign%3Dsig-email%26utm_content%3Demailclient&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7Cb12b7395c8804efcc67c08d8bafdf25b%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637464947146291685%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=CHjOlQKO8loahM67OgRLX6UZ9%2FAHhzY4A%2BqYW%2BNBeXU%3D&amp;reserved=0" originalSrc="http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" shash="S58dWY8TeiEBzl8tfK2nqevTObXsf6EZhhQEKZ2EZD9JpfBayYAQ30GObCyYYNIeTgSpknPhU0YmNYyJtopYBJ8ox46wdKrnz7QhGrON4kwLjkGanTwijkVUU6liFczWChOF1gcctv/W/kcAfdRGh3n69gky+jF/SO52IGFBJRM=" style="color:rgb(68,83,234)" target="_blank">
www.avg.com</a> </td>
</tr>
</tbody>
</table>
<a href="#m_-6312468162313403187_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"></a></div>
</div>
</blockquote>
</div>
</div>
</body>
</html>