Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Today I've started upgrading OTRS from version 2.3 to 2.4 , 2.4 to 3.0 and 3.0 to 3.1. Everything went smoothly except the upgrade from 3.0 to 3.1 OTRS provides a few perl scripts which make the upgrade easier. I've used these scripts for each upgrade step. The upgrade from 3.0 to 3.1 fails at the following after using the upgrade script.


The error is :

root@tickets:/opt/otrs# su - otrs
$ scripts/

Migration started...

Step 1 of 24: Refresh configuration cache... 
If you see warnings about 'Subroutine Load redefined', that's fine, no need to worry!
Subroutine Load redefined at /opt/otrs/Kernel/Config/Files/ line 5.
Subroutine Load redefined at /opt/otrs/Kernel/Config/Files/ line 4.

Step 2 of 24: Check framework version... done.

Step 3 of 24: Creating DynamicField tables (if necessary)... done.

DBD::mysql::db do failed: Cannot add or update a child row: a foreign key constraint fails (`pp_otrs`.`dynamic_field`, CONSTRAINT `FK_dynamic_field_create_by_id` FOREIGN KEY (`create_by`) REFERENCES `users` (`id`)) at /opt/otrs-3.1.10/Kernel/System/ line 478.
ERROR: OTRS-DBUpdate-to-3.1-10 Perl: 5.14.2 OS: linux Time: Wed Sep  5 15:36:20 2012

 Message: Cannot add or update a child row: a foreign key constraint fails (`pp_otrs`.`dynamic_field`, CONSTRAINT `FK_dynamic_field_create_by_id` FOREIGN KEY (`create_by`) REFERENCES `users` (`id`)), SQL: 'INSERT INTO dynamic_field (name, label, field_order, field_type, object_type, config,
                            valid_id, create_time, create_by, change_time, change_by)
                        VALUES (?, ?, ?, 'Text', 'Ticket', '--- {}
', 1, 
        '2012-09-05 15:36:20'
    , 1, 
        '2012-09-05 15:36:20'
    , 1)'

 Traceback (20405): 
   Module: main::_DynamicFieldCreation (v1.85) Line: 466
   Module: scripts/ (v1.85) Line: 95

Could not create new DynamicField TicketFreeKey1 at scripts/ line 477.
Step 4 of 24: Create new dynamic fields for free fields (text, key, date)... $ 

Did anyone else face the same issue? Thanks in advance

share|improve this question
up vote 1 down vote accepted

Can you please execute a SQL statement:

SELECT id, login FROM users WHERE id < 5;

because I think your user 1 does no longer exist?

share|improve this answer
This is what it shows | id | login | +----+------------------+ | 1 | root@localhost | | 2 | | | 3 | asdadasdsadasd | | 4 | asdasdsada | – val0x00ff Sep 7 '12 at 15:19
Could it be that you also upgraded the MySQL server? I know there are issues when you have some tables in InnoDB and some in MyISAM and then try to create foreign keys: – MichielB Sep 10 '12 at 8:06
Mike that's right! I've changed all the MyISAM tables to InnoDB engine type. This is what otrs suggested Thanks for your Support! – val0x00ff Sep 10 '12 at 11:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.