osTicket / osTicket

The osTicket open source ticketing system official project repository, for versions 1.8 and later
osticket.com
GNU General Public License v2.0
3.26k stars 1.67k forks source link

Upgrade from 1.9.3 to 1.9.4rc2 #1266

Closed etomer2014 closed 4 years ago

etomer2014 commented 10 years ago

I started upgrade as follows:

But now i am loked into the "Upgrade broken" Screen, some links how to get helb but i only want to go forward in the Upgrade or start once more.

What ist to do?

greezybacon commented 10 years ago

Did you try the upgrade twice? Like it crashed the first time and you tried again?

etomer2014 commented 10 years ago

I don´t know how to start twice, i´m only in the screen with "Upgrade broken" and the links to prof.support. How can i start from the beginning the upgrad once more? Is there anywhere a marker that i´m upgrading an broken?!? Can i remove it?

vicendominguez commented 10 years ago

Confirmed. Same error for me. The context is:

1.9.3 working

1.- 1.9.4RC2 in a new directory. Not overwritting 1.9.3 version. 2.- Overwrite of the configuration file from 1.9.3 in 1.9.4RC2 3.- Same ddbb from 1.9.3. Not new scheme. 4.- Go to the webpage. It detect the upgrade "automagic". Go ahead. 5.- And it failsl!!!!!! the message is then "Upgrade broken".

Restoring the initial database and files, the recovery to 1.9.3 is possible.

Any alternative way please?????

ntozier commented 10 years ago

Log out and back into osTicket.

vicendominguez commented 10 years ago

Thx for answering ntozier.

Negative.

PHP v5.3 or later - (5.5.16) MySQLi extension for PHP- (module loaded) MySQL v5.0 or later - (5.6.20)

same error.

[INSERT INTO ost_config (namespace, key, value) VALUES ('core', 'number_format', IF(@random, '######', '#')), ('core', 'sequence_id', IF(@random, 0, 1))] Duplicate entry 'core-number_format' for key 'namespace'

bye bye upgrade. :(

any idea?

ntozier commented 10 years ago

Try the new 1.9.4rc3?

vicendominguez commented 10 years ago

Arrrggg!!! Negative. i have tried 1.9.4-rc4 and the error is still here in the upgrade process from 1.9.3 :-1:

[INSERT INTO ost_config (namespace, key, value) VALUES ('core', 'number_format', IF(@random, '######', '#')), ('core', 'sequence_id', IF(@random, 0, 1))] Duplicate entry 'core-number_format' for key 'namespace'

anyone tried with mysqld-5.6.20 before? Am i alone? anyone else?

ntozier commented 10 years ago

After failing to upgrade the first time did you restore your database to your back up before trying again?

vicendominguez commented 10 years ago

Of course my friend. It's in production!.

vicendominguez commented 10 years ago

any idea?

greezybacon commented 10 years ago

Run these commands on your database:

ALTER TABLE `%TABLE_PREFIX%help_topic`
    ADD `flags` int(10) unsigned DEFAULT '0' AFTER `noautoresp`,
    ADD `sequence_id` int(10) unsigned NOT NULL DEFAULT '0' AFTER `form_id`,
    ADD `number_format` varchar(32) DEFAULT NULL AFTER `topic`;

ALTER TABLE  `%TABLE_PREFIX%list`
    ADD  `masks` INT UNSIGNED NOT NULL DEFAULT  '0' AFTER  `sort_mode`,
    ADD `type` VARCHAR( 16 ) NULL DEFAULT NULL AFTER `masks`,
    ADD INDEX ( `type` );

CREATE TABLE IF NOT EXISTS `%TABLE_PREFIX%ticket_status` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(60) NOT NULL DEFAULT '',
  `state` varchar(16) DEFAULT NULL,
  `mode` int(11) unsigned NOT NULL DEFAULT '0',
  `flags` int(11) unsigned NOT NULL DEFAULT '0',
  `sort` int(11) unsigned NOT NULL DEFAULT '0',
  `properties` text NOT NULL,
  `notes` text NOT NULL,
  `created` datetime NOT NULL,
  `updated` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`),
  KEY `state` ( `state` )
) DEFAULT CHARSET=utf8;

ALTER TABLE  `%TABLE_PREFIX%help_topic`
    ADD  `status_id` INT UNSIGNED NOT NULL DEFAULT  '0' AFTER  `noautoresp`;

ALTER TABLE  `%TABLE_PREFIX%filter`
    ADD  `status_id` INT UNSIGNED NOT NULL DEFAULT  '0' AFTER  `email_id`;

ALTER TABLE  `%TABLE_PREFIX%ticket`
    ADD  `status_id` INT UNSIGNED NOT NULL DEFAULT  '0' AFTER  `user_email_id`,
    ADD INDEX (`status_id`);

UPDATE `%TABLE_PREFIX%ticket` SET  `status_id` = 3
    WHERE  `status` = 'closed';

UPDATE `%TABLE_PREFIX%ticket` SET  `status_id` = 1
        WHERE  `status` = 'open';

-- Finished with patch
UPDATE `%TABLE_PREFIX%config`
    SET `value` = '03ff59bf35a58a102e9b32ad33c2839f'
    WHERE `key` = 'schema_signature' AND `namespace` = 'core';

Change %TABLE_PREFIX% to your table prefix, maybe ost_

Ignore any errors, and continue the upgrade.

vicendominguez commented 10 years ago

Perfect!!! Upgrade done. The tickets are disappeared but it seems other issue. I have to research about this.... but thank you very much. I think this thread will be helpful for other people.

greezybacon commented 10 years ago

The tickets are disappeared

What happened?

vicendominguez commented 10 years ago

Same problem upgrading to 1.9.4 (no rc). I can upgrade it with your sql patch but there are not tickets. The table ost_ticket has tickets. But in the webpage they are not there :(

vicendominguez commented 10 years ago

ErrorLog info:

[Mon Dec 01 12:12:15 2014] [error] [client] PHP Fatal error: Call to a member function all() on a non-object in /var/www/osTicket-1.9.4/include/staff/templates/status-options.tmpl.php on line 36, referer: http://xxx.xxxx.net/scp/tickets.php?status=closed [Mon Dec 01 12:12:20 2014] [error] [client] PHP Fatal error: Call to a member function all() on a non-object in /var/www/osTicket-1.9.4/include/staff/templates/status-options.tmpl.php on line 36, referer: http://xxx.xxxx.net/scp/dashboard.php [Mon Dec 01 12:12:21 2014] [error] [client] PHP Fatal error: Call to a member function all() on a non-object in /var/www/osTicket-1.9.4/include/staff/templates/status-options.tmpl.php on line 36, referer: http://xxxx.xxxxx.net/scp/tickets.php

greezybacon commented 9 years ago

There seems to be a glaring issue with the spanish language pack. Could you try adding statuses in the Admin Panel -> Manage -> Lists -> Ticket Status, add a status deriving from "open" and one from "closed".

vicendominguez commented 9 years ago

mmm.... :(

if I try to add one ticket, it doesn't appear there. All (open, closed ..... ) is 0. So is imposible to change the status :(

vicendominguez commented 9 years ago

New info, the code seems to run very bad (i dont know where) because when i ask the closed ticket list is 0:

SELECT 'open', count( ticket.ticket_id ) AS tickets FROM ost_ticket ticket INNER JOIN ost_ticket_status status ON (ticket.status_id=status.id AND status.state='open') WHERE ticket.isanswered = 0 AND ( (ticket.staff_id=1 AND status.state="open") OR ticket.dept_id IN(1,2,3) ) UNION SELECT 'answered', count( ticket.ticket_id ) AS tickets FROM ost_ticket ticket INNER JOIN ost_ticket_status status ON (ticket.status_id=status.id AND status.state='open') WHERE ticket.isanswered = 1 AND ( (ticket.staff_id=1 AND status.state="open") OR ticket.dept_id IN(1,2,3) ) UNION SELECT 'overdue', count( ticket.ticket_id ) AS tickets FROM ost_ticket ticket INNER JOIN ost_ticket_status status ON (ticket.status_id=status.id AND status.state='open') WHERE ticket.isoverdue =1 AND ( (ticket.staff_id=1 AND status.state="open") OR ticket.dept_id IN(1,2,3) ) UNION SELECT 'assigned', count( ticket.ticket_id ) AS tickets FROM ost_ticket ticket INNER JOIN ost_ticket_status status ON (ticket.status_id=status.id AND status.state='open') WHERE ticket.staff_id = 1 AND ( (ticket.staff_id=1 AND status.state="open") OR ticket.dept_id IN(1,2,3) ) UNION SELECT 'closed', count( ticket.ticket_id ) AS tickets FROM ost_ticket ticket INNER JOIN ost_ticket_status status ON (ticket.status_id=status.id AND status.state='closed' ) WHERE 1 AND ( (ticket.staff_id=1 AND status.state="open") OR ticket.dept_id IN(1,2,3) )

The httpd error line (for closed ticket list) says:

[Tue Dec 23 15:36:48 2014] [error] [client 192.168.43.238] PHP Fatal error: Call to a member function all() on a non-object in /var/www/osTicket-1.9.4/include/staff/templates/status-options.tmpl.php on line 36, referer: http://ticketing.xxxxxx.net/scp/tickets.php?status=closed

Looking at the select:

SELECT 'open', count( ticket.ticket_id ) AS tickets FROM ost_ticket ticket INNER JOIN ost_ticket_status status ON (ticket.status_id=status.id AND status.state='open');

but i don't have any data in ost_ticket_status:

select * from ost_ticket_status; Empty set (0,00 sec)

any idea?

greezybacon commented 9 years ago

@vicendominguez looks like a failed upgrade. Can you recover your data from before the upgrade and try again with an updated language pack?

vicendominguez commented 9 years ago

My last point here. Some weeks ago, finally I SOLVED this upgrade issue removing two keys from the ost_config table:

delete from ost_config where ost_config.id=79; delete from ost_config where ost_config.id=80;

I think they were "number_format" and "sequence_id" fields. (i don't remember sorry).

Thanks to everybody for your help.