Problem with migration script MigrateToZnuny7_2.pl

Moderator: crythias

Post Reply
khaed
Znuny newbie
Posts: 9
Joined: 16 Jan 2023, 11:10
Znuny Version: Znuny LTS 6.5.15
Real Name: Sebastian

Problem with migration script MigrateToZnuny7_2.pl

Post by khaed »

Hello,

i tried to upgrade from ZNUNY 6.5.18 to ZNUNY 7.2.3, but when running the migration script "MigrateToZnuny7_2.pl", i run into a problem where it wont upgrade the tabes 'pm_process' and 'pm_process_preferences' because of foreign key constraints. Is there a workaround for this?

Code: Select all

znuny@znuny-srv:~$ scripts/MigrateToZnuny7_2.pl

 Migration started ...

 Checking requirements ...

    Requirement check for: Check required Perl version ...
    Requirement check for: Check required Perl modules ...
    Requirement check for: Check if database has been backed up ...

        Did you backup the database? [Y]es/[N]o: y

    Requirement check for: Check required database version ...
    Requirement check for: Check database default storage engine ...
    Requirement check for: Check if CKEditor migration related entities have been backed up ...

        Did you backup the CKEditor entities? [Y]es/[N]o: y

    Requirement check for: Upgrade database structure ...
    Requirement check for: Check database charset ...
    Requirement check for: Migrate SysConfig settings ...

        Should the SysConfig be migrated? [Y]es/[N]o: y


 Executing tasks ...

    Step 1 of 24: Check required Perl version ...
    Step 2 of 24: Check required Perl modules ...
    Step 3 of 24: Check if database has been backed up ...
    Step 4 of 24: Check required database version ...
    Step 5 of 24: Check database default storage engine ...
    Step 6 of 24: Check if CKEditor migration related entities have been backed up ...
    Step 7 of 24: Upgrade database structure ...
    Step 8 of 24: Alter old entry to avoid conflicts with MariaDB. (AjaxAttachment -> AJAXAttachment) ...
    Step 9 of 24: Migrate database to utf8mb4 ...
[Wed Mar 18 10:47:42 2026] MigrateToZnuny7_2.pl: DBD::mysql::db do failed: Cannot change column 'entity_id': used in a foreign key constraint 'otrs/FK_pm_process_preferences_process_entity_id_entity_id' of table 'otrs/pm_process_preferences' at /opt/znuny-7.2.3/Kernel/System/DB.pm line 571.


ERROR: MigrateToZnuny7_2.pl-10 Perl: 5.40.1 OS: linux Time: Wed Mar 18 10:47:42 2026

 Message: Cannot change column 'entity_id': used in a foreign key constraint 'otrs/FK_pm_process_preferences_process_entity_id_entity_id' of table 'otrs/pm_process_preferences', SQL: 'ALTER TABLE pm_process CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'

 Traceback (1705):
   Module: scripts::Migration::Znuny::MigrateUTF8MB4::_SetCharacterSetTables Line: 211
   Module: scripts::Migration::Znuny::MigrateUTF8MB4::Run Line: 42
   Module: scripts::Migration::_ExecuteComponent Line: 167
   Module: scripts::Migration::Run Line: 77
   Module: scripts/MigrateToZnuny7_2.pl Line: 82


    Error: Could not change character set for table 'pm_process' to utf8mb4!
[Wed Mar 18 10:47:42 2026] MigrateToZnuny7_2.pl: DBD::mysql::db do failed: Cannot change column 'process_entity_id': used in a foreign key constraint 'FK_pm_process_preferences_process_entity_id_entity_id' at /opt/znuny-7.2.3/Kernel/System/DB.pm line 571.


ERROR: MigrateToZnuny7_2.pl-10 Perl: 5.40.1 OS: linux Time: Wed Mar 18 10:47:42 2026

 Message: Cannot change column 'process_entity_id': used in a foreign key constraint 'FK_pm_process_preferences_process_entity_id_entity_id', SQL: 'ALTER TABLE pm_process_preferences CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'

 Traceback (1705):
   Module: scripts::Migration::Znuny::MigrateUTF8MB4::_SetCharacterSetTables Line: 211
   Module: scripts::Migration::Znuny::MigrateUTF8MB4::Run Line: 42
   Module: scripts::Migration::_ExecuteComponent Line: 167
   Module: scripts::Migration::Run Line: 77
   Module: scripts/MigrateToZnuny7_2.pl Line: 82


    Error: Could not change character set for table 'pm_process_preferences' to utf8mb4!

    Error: For the following tables was the change of the character set to utf8mb4 not successfully: 'pm_process', 'pm_process_preferences'.



 Not possible to complete migration. Check previous messages for more information.
paulfolkers
Znuny newbie
Posts: 54
Joined: 19 Jan 2024, 16:07
Znuny Version: 7.2.3
Real Name: Paul Folkers
Company: IT.WESER-EMS
Contact:

Re: Problem with migration script MigrateToZnuny7_2.pl

Post by paulfolkers »

Hi,

did you do the updates to 7.0 and 7.1 in between or did you try to directly update from 6.X to 7.2?
Founder of IT.WESER-EMS (open source-focused IT-consulting) in Oldenburg, Northern Germany.
Dedicated to Znuny, GLPI and CheckMK 8)

Znuny consulting & development via IT.WESER-EMS
khaed
Znuny newbie
Posts: 9
Joined: 16 Jan 2023, 11:10
Znuny Version: Znuny LTS 6.5.15
Real Name: Sebastian

Re: Problem with migration script MigrateToZnuny7_2.pl

Post by khaed »

Hello,

i tried to update from 6.5.18 directly to 7.2.
And now that you mention it... i should have patched to 7.0, then 7.1 and then to 7.2...
Used the wrong update tutorial :roll:
Post Reply