Suitecrm v8.3.0 gives error on missing files that its migration supressed

I did a clean migration “by the book” from v7.13.3 to v8.3.0

Did also a not-mentioned “Rebuild Schedulers” because I think I noticed that Lucene and AOD index were there. Not any more.

Nevertheless, the log complains:

Sat Jun 24 18:12:01 2023 [11455][1][ERROR] Unable to load custom logic file: mod
ules/AOD_Index/AOD_LogicHooks.php

That are not there anymore, suppressed by the migrator, because they exist on the v7 tree on:

/modules/AOD Index/AOD_LogicHooks.php

I think this is related to the email import errors I’m having, that does not exist on the migrated v7. Must say that I restore the v7 database to a new v8 database and pointed config.php to it.

I’m trying to migrate to v8 for so long, can anyone please help?

Look for references to that logic hook

grep -irn AOD_LogicHooks .

Hello again @pgr, thank you for helping.

root@webserver:/usr/local/www/apache24/data/crm8 # grep -irn AOD_LogicHooks .
./tmp/package/upgrade/SuiteCRM-8.3.0-backup/modules/AOD_Index/AOD_LogicHooks.php:25:class AOD_LogicHooks
./public/legacy/custom/modules/logic_hooks.php:8:$hook_array['after_save'][] = Array(1, 'AOD Index Changes', 'modules/AOD_Index/AOD_LogicHooks.php','AOD_LogicHooks', 'saveModuleChanges'); 
./public/legacy/custom/modules/logic_hooks.php:12:$hook_array['after_delete'][] = Array(1, 'AOD Index changes', 'modules/AOD_Index/AOD_LogicHooks.php','AOD_LogicHooks', 'saveModuleDelete'); 
./public/legacy/custom/modules/logic_hooks.php:15:$hook_array['after_restore'][] = Array(1, 'AOD Index changes', 'modules/AOD_Index/AOD_LogicHooks.php','AOD_LogicHooks', 'saveModuleRestore'); 
./public/legacy/suitecrm.log:77323:Sat Jun 24 22:36:00 2023 [20902][1][ERROR] Unable to load custom logic file: modules/AOD_Index/AOD_LogicHooks.php
./public/legacy/suitecrm.log:77325:Sat Jun 24 22:36:00 2023 [20902][1][ERROR] Unable to load custom logic file: modules/AOD_Index/AOD_LogicHooks.php

# Follows a huge quantity of the above ERROR lines

I think you’ll agree that ./public/legacy/custom/modules/logic_hooks.php calls for ./public/legacy/modules/AOD_Index/AOD_LogicHooks.php but it is not there, nor anywhere else except in the backup.

I thought that it could happen that I might had run the migrator before restoring the v7 database to a new v8 database and so not giving the migrator the chance to touch the new database and so I’ve repeated the whole process just to be sure; the result is the same and the grep above was taken after this repetition.

You just need to remove those references from that file

public/legacy/custom/modules/logic_hooks.php

note that it’s a custom file, so it’s probably something from your previous installation. I suppose you have your own hooks defined there?

No, I never created hooks, at least that I’m aware of. The file says: "This file will be automatically rebuilt in the future. "

Being custom means I can delete it, which I did and this log error went away. The file contents is:

# cat logic_hooks.php.
<?php
// Do not store anything in this file that is not part of the array or the hook version.  This file will	
// be automatically rebuilt in the future. 
 $hook_version = 1; 
$hook_array = Array(); 
// position, file, function 
$hook_array['after_save'] = Array(); 
$hook_array['after_save'][] = Array(1, 'AOD Index Changes', 'modules/AOD_Index/AOD_LogicHooks.php','AOD_LogicHooks', 'saveModuleChanges'); 
$hook_array['after_save'][] = Array(1, 'ElasticSearch Index Changes', 'lib/Search/ElasticSearch/ElasticSearchHooks.php','SuiteCRM\Search\ElasticSearch\ElasticSearchHooks', 'beanSaved'); 
$hook_array['after_save'][] = Array(30, 'popup_select', 'modules/SecurityGroups/AssignGroups.php','AssignGroups', 'popup_select'); 
$hook_array['after_delete'] = Array(); 
$hook_array['after_delete'][] = Array(1, 'AOD Index changes', 'modules/AOD_Index/AOD_LogicHooks.php','AOD_LogicHooks', 'saveModuleDelete'); 
$hook_array['after_delete'][] = Array(1, 'ElasticSearch Index Changes', 'lib/Search/ElasticSearch/ElasticSearchHooks.php','SuiteCRM\Search\ElasticSearch\ElasticSearchHooks', 'beanDeleted'); 
$hook_array['after_restore'] = Array(); 
$hook_array['after_restore'][] = Array(1, 'AOD Index changes', 'modules/AOD_Index/AOD_LogicHooks.php','AOD_LogicHooks', 'saveModuleRestore'); 
$hook_array['after_ui_footer'] = Array(); 
$hook_array['after_ui_footer'][] = Array(10, 'popup_onload', 'modules/SecurityGroups/AssignGroups.php','AssignGroups', 'popup_onload'); 
$hook_array['after_ui_frame'] = Array(); 
$hook_array['after_ui_frame'][] = Array(20, 'mass_assign', 'modules/SecurityGroups/AssignGroups.php','AssignGroups', 'mass_assign'); 
$hook_array['after_ui_frame'][] = Array(1, 'Load Social JS', 'include/social/hooks.php','hooks', 'load_js'); 
?>

But the email import “An unknown error has occurred” persists.

In the logs there are also a ton of other errors and also fatals, the kind of:

[FATAL] Job 4c3c869e-5c0b-c988-8ad2-649821cde905 (Check Inbound Mailboxes) failed in CRON run
[ERROR] Unable to find relationship emails_email_templates
[ERROR] Unable to find relationship am_projecttemplates_users_resources
[ERROR] Unable to find relationship projects_users_resources
[ERROR] Unable to find relationship projects_quotes

This was after rebuilding almost everything under Admin/Repair

On the v7, the log also shows the fatal above but in both versions the emails list correctly.
The relationship errors do not show on the v7.
But on the v7 I have other errors “Invalid Email Address”, which apparently do not have consequences.

I also suspect that the problem I reported on not-compatible-with-utfmb4 has returned reversed, meaning that now the application demands utfmb4 and the email import error is due to this.

Strangely, I couldn’t find any reference to character encoding on the documents, even developer’s. Even when the installation guide says that the user must setup a database, it says nothing about how to.

Well, I have a lot to do if I want to ever get v8 running. Your help will be much appreciated, if you will.

Next step is converting the database to utfmb4 just to check if email import works.

EDIT: No, converting to utfmb4 didn’t work, the emails don’t even list as they did before.
I think I’ll wait for the next upgrade to keep on trying. Will I ever achieve? After one year or so, I’m a little bitter; I really wonder how/if people are using this.

EDIT2: I’ve made a new migration with -override option, doesn’t work either.
I guess this means all my customization is overridden. What I find strange is that all my custom/modules are still there; seems that -override doesn’t work.
I don’t know what else I have to be possibly blamed.