Upgrading from 2.3.4 -> 2.4.12 -> 3.0.12 -> 3.1.4

Moderator: crythias

Locked
jfreeman2nc
Znuny advanced
Posts: 136
Joined: 04 Oct 2010, 14:14
Znuny Version: 3.0.10; 3.1.4
Location: US, SC
Contact:

Upgrading from 2.3.4 -> 2.4.12 -> 3.0.12 -> 3.1.4

Post by jfreeman2nc »

Ok so I have been given the task of upgrading a OTRS 2.3.4 installation to 3.1.4 in Windows.

So I initially created a mysql dump of the 2.3.4 mysql database, copied the file directories, and moved these backups over to a new test server.

Upon moving to the test server, I reinstalled 2.3.4, restored the database, config.pm, zzzauto.pm, sysconfig, etc. and verified that my backups were good. Was able to connect to OTRS, see tickets, search, check configurations, etc. Everything looked good, no errors. So I then proceeded down the upgrade path.

I made another mysql dump, backed up the file structure, just to be safe, and then uninstalled 2.3.4. I then installed 2.4.12, did not initiate the web installer, updated the config.pm, zzzauto.pm, and created the otrs database through the MySQL command line. Granted user access on the database, and then restored the mysql dump. Afterwards, ran the DBupdate-to-2.4.mysql.sql (no errors), DBUpdate-to.2.4.pl (OK), and then DBUpdate-to-2.4-post.mysql.sql(OK). Launched OTRS, logged in and then loaded the backup sysconfig. Everything looked OK, tickets good, configurations good. So I again created another MySQL dump, backed up files, and again headed towards installing 3.0.12.

Repeated basically the same steps with 3.0.12. Upon running the DBUpdate scripts, I encountered no errors. Then performed another mysql dump, backed up the files, etc and started to finalize the upgrade to 3.1.4.

Created the otrs database from the command line, and granted permissions, then restored the mysql dump from 3.0.12. Upon running the upgrade database scripts. I received the following errors:

Code: Select all

C:\PROGRA~1\OTRS\OTRS\scripts>mysql -uroot otrs < DBUpdate-to-3.1.mysql.sql
ERROR 1050 (42S01) at line 28: Table 'gi_webservice_config' already exists

C:\PROGRA~1\OTRS\OTRS\scripts>perl DBUpdate-to-3.1.pl

Migration started...

Step 1 of 24: Refresh configuration cache...
If you see warnings about 'Subroutine Load redefined', that's fine, no need to w
orry!
Subroutine Load redefined at C:/PROGRA~1/OTRS/OTRS/Kernel/Config/Files/ZZZAAuto.
pm line 5.
Subroutine Load redefined at C:/PROGRA~1/OTRS/OTRS/Kernel/Config/Files/ZZZAuto.p
m line 5.
done.

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

DBD::mysql::db do failed: Table 'otrs.dynamic_field' doesn't exist at C:/PROGRA~
1/OTRS/OTRS/Kernel/System/DB.pm line 478.
ERROR: OTRS-DBUpdate-to-3.1-10 Perl: 5.12.3 OS: MSWin32 Time: Thu Apr 26 07:55:3
1 2012

 Message: Table 'otrs.dynamic_field' doesn't exist, SQL: 'SELECT count(id) FROM
dynamic_field'

 Traceback (2308):
   Module: main::_CheckDynamicFieldTables (v1.85) Line: 385
   Module: DBUpdate-to-3.1.pl (v1.85) Line: 86

Check if dynamic_field table exists, failed! at DBUpdate-to-3.1.pl line 390.
Step 3 of 24: Creating DynamicField tables (if necessary)...
C:\PROGRA~1\OTRS\OTRS\scripts>mysql -uroot otrs < DBUpdate-to-3.1-post.mysql.sql

ERROR 1091 (42000) at line 7: Can't DROP 'freetext1'; check that column/key exis
ts

C:\PROGRA~1\OTRS\OTRS\scripts>



I am also seeing the same error in "Postmaster Mail Accounts" that was discussed in the following thread, viewtopic.php?f=53&t=14836&p=57235&hili ... 1.4#p57235

The previous accounts were not brought over from the database restore, I see the following if I try to add an email account:

Code: Select all

Postmaster Mail Error

Unknown column 'imap_folder' in 'field list', SQL: 'INSERT INTO mail_account (login, pw, host, account_type, valid_id, comments, queue_id, imap_folder, trusted, create_time, create_by, change_time, change_by) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, '2012-04-26 08:19:53' , ?, '2012-04-26 08:19:53' , ?)' 
Any help would be greatly appreciated!!
OTRS 3.1.4
Windows Server 2008 R2
MySQL

OTRS 3.0.10 - soon to be 3.0.12 or 3.1.4
Windows Server 2008 R2
MySQL DB
fbeaugra
Znuny newbie
Posts: 2
Joined: 26 Jan 2011, 16:41
Znuny Version: 3.0.2

Re: Upgrading from 2.3.4 -> 2.4.12 -> 3.0.12 -> 3.1.4

Post by fbeaugra »

Hi

I got the same issue while upgrading to 3.1.9...

Did someone resolve the issue ?

Thanks
Frederic
Eraserhead
Znuny newbie
Posts: 33
Joined: 05 Apr 2011, 05:28
Znuny Version: 3.0.5

Re: Upgrading from 2.3.4 -> 2.4.12 -> 3.0.12 -> 3.1.4

Post by Eraserhead »

I know it has been 3 years since the last post but i also ran into this issue and i'm just posting my fix here.

The error message you get is because something went wrong with the database upgrade which was supposed to be performed in the previous step. According to the OTRS upgrade manual you have to use this command to upgrade the database:

shell> cat scripts/DBUpdate-to-3.2.mysql.sql | mysql -p -f -u root otrs

For some reason that didn't work for me. It's better to do it in steps so you see if it all goes without problems:

Open de MySQL command line first:
mysql -p -u root
Then choose the otrs database:
mysql> use otrs
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
Now execute the datbase upgrade file (remember, choose the right version of the file to where you want to upgrade!):
mysql> \. /opt/otrs/scripts/DBUpdate-to-3.1.mysql.sql
Query OK, 0 rows affected (0.06 sec)
Records: 0 Duplicates: 0 Warnings: 0

Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0

Query OK, 0 rows affected (0.00 sec)
Rows matched: 0 Changed: 0 Warnings: 0

Query OK, 0 rows affected (0.02 sec)
Records: 0 Duplicates: 0 Warnings: 0

Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0

Query OK, 0 rows affected (0.03 sec)
Records: 0 Duplicates: 0 Warnings: 0

Query OK, 0 rows affected (0.00 sec)
Rows matched: 0 Changed: 0 Warnings: 0

Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0

Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0

Query OK, 0 rows affected (0.04 sec)
Records: 0 Duplicates: 0 Warnings: 0

Query OK, 0 rows affected (0.00 sec)
Rows matched: 0 Changed: 0 Warnings: 0

Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.02 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 1 row affected (0.01 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.02 sec)
Records: 0 Duplicates: 0 Warnings: 0

Query OK, 0 rows affected (0.00 sec)
Rows matched: 0 Changed: 0 Warnings: 0

Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 4 rows affected (0.03 sec)
Records: 4 Duplicates: 0 Warnings: 0

Query OK, 0 rows affected (0.00 sec)
Records: 0 Duplicates: 0 Warnings: 0

Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0

Query OK, 0 rows affected (0.00 sec)
Records: 0 Duplicates: 0 Warnings: 0

Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0

Query OK, 0 rows affected (0.00 sec)
Records: 0 Duplicates: 0 Warnings: 0

Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0

Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0

Query OK, 0 rows affected (0.00 sec)
Records: 0 Duplicates: 0 Warnings: 0

Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0

Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0

Query OK, 0 rows affected (0.00 sec)
Records: 0 Duplicates: 0 Warnings: 0

Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0

Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0

Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0

Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0
You can see a few rows were changed.

Now exit mysql:
mysql> exit
Bye
And then run the upgrade script:
scripts/DBUpdate-to-3.1.pl

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/ZZZAAuto.pm line 5.
Subroutine Load redefined at /opt/otrs/Kernel/Config/Files/ZZZAuto.pm line 5.
done.

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

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

Step 4 of 24: Create new dynamic fields for free fields (text, key, date)... done.

Step 5 of 24: Migrate ticket free fields to dynamic fields...

Migrated 0 tickets of 0 (with Free fields data).
done.

Step 6 of 24: Migrate article free fields to dynamic fields...

Migrated 0 articles of 0 (with Free fields data).
done.

Step 7 of 24: Verify if ticket data was successfully migrated...

Verified 0 tickets of 0 (with Free fields data).
done.

Step 8 of 24: Verify if article data was successfully migrated...
Verified 0 articles of 0 (with Free fields data).
done.

Step 9 of 24: Migrate free fields configuration... done.

Step 10 of 24: Update history type from 'TicketFreeTextUpdate' to 'TicketDynamicFieldUpdate'... done.

Step 11 of 24: Migrate free fields window configuration... done.

Step 12 of 24: Migrate free fields stats configuration... done.

Step 13 of 24: Migrate free fields generic agent jobs configuration... done.

Step 14 of 24: Migrate free fields post master configuration... done.

Step 15 of 24: Migrate free fields standard responses configuration... done.

Step 16 of 24: Migrate free fields auto responses configuration... done.

Step 17 of 24: Migrate free fields salutations configuration... done.

Step 18 of 24: Migrate free fields signatures configuration... done.

Step 19 of 24: Migrate free fields search profiles configuration... done.

Step 20 of 24: Migrate free fields notifications configuration... done.

Step 21 of 24: Migrate free fields notification event configuration... done.

Step 22 of 24: Checking for duplicate entries on ticket_flag table...
Deleting duplicate ticket_flag entries for ticket 3450, key 'Seen', user 3
done.

Step 23 of 24: Clean up the cache... done.

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

Migration completed!
Locked