Mysql error updating from 3.2.3 to 3.4.3

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
drzoom
Posts: 9
Joined: Tue Apr 25, 2023 11:06 am

Mysql error updating from 3.2.3 to 3.4.3

Post by drzoom »

Version HESK 3.2.3
Versión PHP 8.1.18 (MySQLi)
Versión MySQL 8.0.30


Hi, this is the error I get when updating to 3.4.3 from 3.2.3 using the provided update patch:

Error

Can't execute SQL: ALTER TABLE `hesk_tickets` ADD COLUMN `message_html` mediumtext DEFAULT NULL AFTER `message`

MySQL said:
Duplicate column name 'message_html'
Klemen
Site Admin
Posts: 10141
Joined: Fri Feb 11, 2005 4:04 pm

Re: Mysql error updating from 3.2.3 to 3.4.3

Post by Klemen »

This happens when there was previously the unofficial "Mods for Hesk installed" in the help desk (for Hesk 2), but it was not uninstalled correctly.

Paste the structure (not data) of your hesk_tables table here so we can check what fields are missing. You can get the table structure from a tool such as phpMyAdmin
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
drzoom
Posts: 9
Joined: Tue Apr 25, 2023 11:06 am

Re: Mysql error updating from 3.2.3 to 3.4.3

Post by drzoom »

Thanks for answering, here is the structure:


-- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost:3306
-- Tiempo de generación: 27-04-2023 a las 08:51:20
-- Versión del servidor: 5.7.32
-- Versión de PHP: 7.3.22

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Base de datos: `hesk`
--

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `hesk_attachments`
--

CREATE TABLE `hesk_attachments` (
`att_id` mediumint(8) UNSIGNED NOT NULL,
`ticket_id` varchar(13) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`saved_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`real_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`size` int(10) UNSIGNED NOT NULL DEFAULT '0',
`type` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `hesk_banned_emails`
--

CREATE TABLE `hesk_banned_emails` (
`id` smallint(5) UNSIGNED NOT NULL,
`email` varchar(255) NOT NULL,
`banned_by` smallint(5) UNSIGNED NOT NULL,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `hesk_banned_ips`
--

CREATE TABLE `hesk_banned_ips` (
`id` smallint(5) UNSIGNED NOT NULL,
`ip_from` int(10) UNSIGNED NOT NULL DEFAULT '0',
`ip_to` int(10) UNSIGNED NOT NULL DEFAULT '0',
`ip_display` varchar(100) NOT NULL,
`banned_by` smallint(5) UNSIGNED NOT NULL,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `hesk_categories`
--

CREATE TABLE `hesk_categories` (
`id` smallint(5) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`cat_order` smallint(5) UNSIGNED NOT NULL DEFAULT '0',
`autoassign` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
`type` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
`priority` enum('0','1','2','3') COLLATE utf8_unicode_ci NOT NULL DEFAULT '3'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `hesk_custom_fields`
--

CREATE TABLE `hesk_custom_fields` (
`id` tinyint(3) UNSIGNED NOT NULL,
`use` enum('0','1','2') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
`place` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
`type` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'text',
`req` enum('0','1','2') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
`category` text COLLATE utf8_unicode_ci,
`name` text COLLATE utf8_unicode_ci,
`value` text COLLATE utf8_unicode_ci,
`order` smallint(5) UNSIGNED NOT NULL DEFAULT '10'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `hesk_custom_statuses`
--

CREATE TABLE `hesk_custom_statuses` (
`id` tinyint(3) UNSIGNED NOT NULL,
`name` text COLLATE utf8_unicode_ci NOT NULL,
`color` varchar(6) COLLATE utf8_unicode_ci NOT NULL,
`can_customers_change` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
`order` smallint(5) UNSIGNED NOT NULL DEFAULT '10'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `hesk_kb_articles`
--

CREATE TABLE `hesk_kb_articles` (
`id` smallint(5) UNSIGNED NOT NULL,
`catid` smallint(5) UNSIGNED NOT NULL,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`author` smallint(5) UNSIGNED NOT NULL,
`subject` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`content` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`keywords` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`rating` float NOT NULL DEFAULT '0',
`votes` mediumint(8) UNSIGNED NOT NULL DEFAULT '0',
`views` mediumint(8) UNSIGNED NOT NULL DEFAULT '0',
`type` enum('0','1','2') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
`html` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
`sticky` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
`art_order` smallint(5) UNSIGNED NOT NULL DEFAULT '0',
`history` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`attachments` mediumtext COLLATE utf8_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `hesk_kb_attachments`
--

CREATE TABLE `hesk_kb_attachments` (
`att_id` mediumint(8) UNSIGNED NOT NULL,
`saved_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`real_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`size` int(10) UNSIGNED NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `hesk_kb_categories`
--

CREATE TABLE `hesk_kb_categories` (
`id` smallint(5) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`parent` smallint(5) UNSIGNED NOT NULL,
`articles` smallint(5) UNSIGNED NOT NULL DEFAULT '0',
`articles_private` smallint(5) UNSIGNED NOT NULL DEFAULT '0',
`articles_draft` smallint(5) UNSIGNED NOT NULL DEFAULT '0',
`cat_order` smallint(5) UNSIGNED NOT NULL,
`type` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `hesk_logins`
--

CREATE TABLE `hesk_logins` (
`ip` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`number` tinyint(3) UNSIGNED NOT NULL DEFAULT '1',
`last_attempt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `hesk_log_overdue`
--

CREATE TABLE `hesk_log_overdue` (
`id` int(10) UNSIGNED NOT NULL,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`ticket` mediumint(8) UNSIGNED NOT NULL,
`category` smallint(5) UNSIGNED NOT NULL,
`priority` enum('0','1','2','3') COLLATE utf8_unicode_ci NOT NULL,
`status` tinyint(3) UNSIGNED NOT NULL,
`owner` smallint(5) UNSIGNED NOT NULL DEFAULT '0',
`due_date` timestamp NOT NULL DEFAULT '1999-12-31 23:00:00',
`comments` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `hesk_mail`
--

CREATE TABLE `hesk_mail` (
`id` int(10) UNSIGNED NOT NULL,
`from` smallint(5) UNSIGNED NOT NULL,
`to` smallint(5) UNSIGNED NOT NULL,
`subject` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`message` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`read` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
`deletedby` smallint(5) UNSIGNED NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `hesk_notes`
--

CREATE TABLE `hesk_notes` (
`id` mediumint(8) UNSIGNED NOT NULL,
`ticket` mediumint(8) UNSIGNED NOT NULL,
`who` smallint(5) UNSIGNED NOT NULL,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`message` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`attachments` mediumtext COLLATE utf8_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `hesk_online`
--

CREATE TABLE `hesk_online` (
`user_id` smallint(5) UNSIGNED NOT NULL,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`tmp` int(11) UNSIGNED NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `hesk_pipe_loops`
--

CREATE TABLE `hesk_pipe_loops` (
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`hits` smallint(1) UNSIGNED NOT NULL DEFAULT '0',
`message_hash` char(32) COLLATE utf8_unicode_ci NOT NULL,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `hesk_replies`
--

CREATE TABLE `hesk_replies` (
`id` mediumint(8) UNSIGNED NOT NULL,
`replyto` mediumint(8) UNSIGNED NOT NULL DEFAULT '0',
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`message` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`message_html` mediumtext COLLATE utf8_unicode_ci,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`attachments` mediumtext COLLATE utf8_unicode_ci,
`staffid` smallint(5) UNSIGNED NOT NULL DEFAULT '0',
`rating` enum('1','5') COLLATE utf8_unicode_ci DEFAULT NULL,
`read` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `hesk_reply_drafts`
--

CREATE TABLE `hesk_reply_drafts` (
`owner` smallint(5) UNSIGNED NOT NULL,
`ticket` mediumint(8) UNSIGNED NOT NULL,
`message` mediumtext CHARACTER SET utf8 NOT NULL,
`message_html` mediumtext COLLATE utf8_unicode_ci,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `hesk_reset_password`
--

CREATE TABLE `hesk_reset_password` (
`id` mediumint(8) UNSIGNED NOT NULL,
`user` smallint(5) UNSIGNED NOT NULL,
`hash` char(40) NOT NULL,
`ip` varchar(45) NOT NULL,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `hesk_service_messages`
--

CREATE TABLE `hesk_service_messages` (
`id` smallint(5) UNSIGNED NOT NULL,
`dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`author` smallint(5) UNSIGNED NOT NULL,
`title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`message` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`language` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`style` enum('0','1','2','3','4') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
`type` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
`order` smallint(5) UNSIGNED NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `hesk_std_replies`
--

CREATE TABLE `hesk_std_replies` (
`id` smallint(5) UNSIGNED NOT NULL,
`title` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`message` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`message_html` mediumtext COLLATE utf8_unicode_ci,
`reply_order` smallint(5) UNSIGNED NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `hesk_tickets`
--

CREATE TABLE `hesk_tickets` (
`id` mediumint(8) UNSIGNED NOT NULL,
`trackid` varchar(13) COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`email` varchar(1000) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`category` smallint(5) UNSIGNED NOT NULL DEFAULT '1',
`priority` enum('0','1','2','3') COLLATE utf8_unicode_ci NOT NULL DEFAULT '3',
`subject` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`message` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`message_html` mediumtext COLLATE utf8_unicode_ci,
`dt` timestamp NOT NULL DEFAULT '2000-01-01 05:00:00',
`lastchange` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`firstreply` timestamp NULL DEFAULT NULL,
`closedat` timestamp NULL DEFAULT NULL,
`articles` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`ip` varchar(45) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`language` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`status` tinyint(3) UNSIGNED NOT NULL DEFAULT '0',
`openedby` mediumint(8) DEFAULT '0',
`firstreplyby` smallint(5) UNSIGNED DEFAULT NULL,
`closedby` mediumint(8) DEFAULT NULL,
`replies` smallint(5) UNSIGNED NOT NULL DEFAULT '0',
`staffreplies` smallint(5) UNSIGNED NOT NULL DEFAULT '0',
`owner` smallint(5) UNSIGNED NOT NULL DEFAULT '0',
`assignedby` mediumint(9) DEFAULT NULL,
`time_worked` time NOT NULL DEFAULT '00:00:00',
`lastreplier` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
`replierid` smallint(5) UNSIGNED DEFAULT NULL,
`archive` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
`locked` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
`attachments` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`merged` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`history` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom1` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom2` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom3` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom4` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom5` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom6` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom7` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom8` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom9` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom10` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom11` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom12` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom13` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom14` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom15` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom16` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom17` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom18` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom19` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom20` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom21` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom22` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom23` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom24` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom25` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom26` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom27` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom28` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom29` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom30` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom31` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom32` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom33` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom34` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom35` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom36` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom37` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom38` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom39` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom40` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom41` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom42` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom43` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom44` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom45` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom46` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom47` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom48` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom49` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`custom50` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`due_date` timestamp NULL DEFAULT NULL,
`overdue_email_sent` tinyint(1) DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `hesk_ticket_templates`
--

CREATE TABLE `hesk_ticket_templates` (
`id` smallint(5) UNSIGNED NOT NULL,
`title` varchar(100) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`message` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`message_html` mediumtext COLLATE utf8_unicode_ci,
`tpl_order` smallint(5) UNSIGNED NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `hesk_users`
--

CREATE TABLE `hesk_users` (
`id` smallint(5) UNSIGNED NOT NULL,
`user` varchar(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`pass` char(40) COLLATE utf8_unicode_ci NOT NULL,
`isadmin` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`signature` varchar(1000) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`language` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`categories` varchar(500) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`afterreply` enum('0','1','2') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
`autostart` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
`autoreload` smallint(5) UNSIGNED NOT NULL DEFAULT '0',
`notify_customer_new` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
`notify_customer_reply` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
`show_suggested` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
`notify_new_unassigned` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
`notify_new_my` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
`notify_reply_unassigned` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
`notify_reply_my` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
`notify_assigned` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
`notify_pm` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
`notify_note` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
`notify_overdue_unassigned` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
`notify_overdue_my` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
`default_list` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`autoassign` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
`heskprivileges` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
`ratingneg` mediumint(8) UNSIGNED NOT NULL DEFAULT '0',
`ratingpos` mediumint(8) UNSIGNED NOT NULL DEFAULT '0',
`rating` float NOT NULL DEFAULT '0',
`replies` mediumint(8) UNSIGNED NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Índices para tablas volcadas
--

--
-- Indices de la tabla `hesk_attachments`
--
ALTER TABLE `hesk_attachments`
ADD PRIMARY KEY (`att_id`),
ADD KEY `ticket_id` (`ticket_id`);

--
-- Indices de la tabla `hesk_banned_emails`
--
ALTER TABLE `hesk_banned_emails`
ADD PRIMARY KEY (`id`),
ADD KEY `email` (`email`);

--
-- Indices de la tabla `hesk_banned_ips`
--
ALTER TABLE `hesk_banned_ips`
ADD PRIMARY KEY (`id`);

--
-- Indices de la tabla `hesk_categories`
--
ALTER TABLE `hesk_categories`
ADD PRIMARY KEY (`id`),
ADD KEY `type` (`type`);

--
-- Indices de la tabla `hesk_custom_fields`
--
ALTER TABLE `hesk_custom_fields`
ADD PRIMARY KEY (`id`),
ADD KEY `useType` (`use`,`type`);

--
-- Indices de la tabla `hesk_custom_statuses`
--
ALTER TABLE `hesk_custom_statuses`
ADD PRIMARY KEY (`id`);

--
-- Indices de la tabla `hesk_kb_articles`
--
ALTER TABLE `hesk_kb_articles`
ADD PRIMARY KEY (`id`),
ADD KEY `catid` (`catid`),
ADD KEY `sticky` (`sticky`),
ADD KEY `type` (`type`);
ALTER TABLE `hesk_kb_articles` ADD FULLTEXT KEY `subject` (`subject`,`content`,`keywords`);

--
-- Indices de la tabla `hesk_kb_attachments`
--
ALTER TABLE `hesk_kb_attachments`
ADD PRIMARY KEY (`att_id`);

--
-- Indices de la tabla `hesk_kb_categories`
--
ALTER TABLE `hesk_kb_categories`
ADD PRIMARY KEY (`id`),
ADD KEY `type` (`type`),
ADD KEY `parent` (`parent`);

--
-- Indices de la tabla `hesk_logins`
--
ALTER TABLE `hesk_logins`
ADD UNIQUE KEY `ip` (`ip`);

--
-- Indices de la tabla `hesk_log_overdue`
--
ALTER TABLE `hesk_log_overdue`
ADD PRIMARY KEY (`id`),
ADD KEY `ticket` (`ticket`),
ADD KEY `category` (`category`),
ADD KEY `priority` (`priority`),
ADD KEY `status` (`status`),
ADD KEY `owner` (`owner`);

--
-- Indices de la tabla `hesk_mail`
--
ALTER TABLE `hesk_mail`
ADD PRIMARY KEY (`id`),
ADD KEY `from` (`from`),
ADD KEY `to` (`to`,`read`,`deletedby`);

--
-- Indices de la tabla `hesk_notes`
--
ALTER TABLE `hesk_notes`
ADD PRIMARY KEY (`id`),
ADD KEY `ticketid` (`ticket`);

--
-- Indices de la tabla `hesk_online`
--
ALTER TABLE `hesk_online`
ADD UNIQUE KEY `user_id` (`user_id`),
ADD KEY `dt` (`dt`);

--
-- Indices de la tabla `hesk_pipe_loops`
--
ALTER TABLE `hesk_pipe_loops`
ADD KEY `email` (`email`,`hits`);

--
-- Indices de la tabla `hesk_replies`
--
ALTER TABLE `hesk_replies`
ADD PRIMARY KEY (`id`),
ADD KEY `replyto` (`replyto`),
ADD KEY `dt` (`dt`),
ADD KEY `staffid` (`staffid`);

--
-- Indices de la tabla `hesk_reply_drafts`
--
ALTER TABLE `hesk_reply_drafts`
ADD KEY `owner` (`owner`),
ADD KEY `ticket` (`ticket`);

--
-- Indices de la tabla `hesk_reset_password`
--
ALTER TABLE `hesk_reset_password`
ADD PRIMARY KEY (`id`),
ADD KEY `user` (`user`);

--
-- Indices de la tabla `hesk_service_messages`
--
ALTER TABLE `hesk_service_messages`
ADD PRIMARY KEY (`id`),
ADD KEY `type` (`type`);

--
-- Indices de la tabla `hesk_std_replies`
--
ALTER TABLE `hesk_std_replies`
ADD PRIMARY KEY (`id`);

--
-- Indices de la tabla `hesk_tickets`
--
ALTER TABLE `hesk_tickets`
ADD PRIMARY KEY (`id`),
ADD KEY `trackid` (`trackid`),
ADD KEY `archive` (`archive`),
ADD KEY `categories` (`category`),
ADD KEY `statuses` (`status`),
ADD KEY `owner` (`owner`),
ADD KEY `openedby` (`openedby`,`firstreplyby`,`closedby`),
ADD KEY `dt` (`dt`),
ADD KEY `assignedby` (`assignedby`);

--
-- Indices de la tabla `hesk_ticket_templates`
--
ALTER TABLE `hesk_ticket_templates`
ADD PRIMARY KEY (`id`);

--
-- Indices de la tabla `hesk_users`
--
ALTER TABLE `hesk_users`
ADD PRIMARY KEY (`id`),
ADD KEY `autoassign` (`autoassign`);

--
-- AUTO_INCREMENT de las tablas volcadas
--

--
-- AUTO_INCREMENT de la tabla `hesk_attachments`
--
ALTER TABLE `hesk_attachments`
MODIFY `att_id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `hesk_banned_emails`
--
ALTER TABLE `hesk_banned_emails`
MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `hesk_banned_ips`
--
ALTER TABLE `hesk_banned_ips`
MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `hesk_categories`
--
ALTER TABLE `hesk_categories`
MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `hesk_kb_articles`
--
ALTER TABLE `hesk_kb_articles`
MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `hesk_kb_attachments`
--
ALTER TABLE `hesk_kb_attachments`
MODIFY `att_id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `hesk_kb_categories`
--
ALTER TABLE `hesk_kb_categories`
MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `hesk_log_overdue`
--
ALTER TABLE `hesk_log_overdue`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `hesk_mail`
--
ALTER TABLE `hesk_mail`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `hesk_notes`
--
ALTER TABLE `hesk_notes`
MODIFY `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `hesk_replies`
--
ALTER TABLE `hesk_replies`
MODIFY `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `hesk_reset_password`
--
ALTER TABLE `hesk_reset_password`
MODIFY `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `hesk_service_messages`
--
ALTER TABLE `hesk_service_messages`
MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `hesk_std_replies`
--
ALTER TABLE `hesk_std_replies`
MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `hesk_tickets`
--
ALTER TABLE `hesk_tickets`
MODIFY `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `hesk_ticket_templates`
--
ALTER TABLE `hesk_ticket_templates`
MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT de la tabla `hesk_users`
--
ALTER TABLE `hesk_users`
MODIFY `id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
Klemen
Site Admin
Posts: 10141
Joined: Fri Feb 11, 2005 4:04 pm

Re: Mysql error updating from 3.2.3 to 3.4.3

Post by Klemen »

In the /install/update.php try deleting the line 1259:

Code: Select all

hesk_dbQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."replies` SET `message_html` = `message` WHERE `message_html` IS NULL");
Then try again.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
drzoom
Posts: 9
Joined: Tue Apr 25, 2023 11:06 am

Re: Mysql error updating from 3.2.3 to 3.4.3

Post by drzoom »

Same error, did not work out.
Klemen
Site Admin
Posts: 10141
Joined: Fri Feb 11, 2005 4:04 pm

Re: Mysql error updating from 3.2.3 to 3.4.3

Post by Klemen »

Are you updating on the exact database you posted above or something else?

Because of what you posted above, the update script would start at the line I told you and would ignore the previous lines...
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
drzoom
Posts: 9
Joined: Tue Apr 25, 2023 11:06 am

Re: Mysql error updating from 3.2.3 to 3.4.3

Post by drzoom »

Yes, it is the same database.
I just deleted the indicated line in update.php and run it again.

I think it skips the "if" because current version is 3.2.3

// Updating 3.2.0 and 3.2.1 to 3.2.2
if ($update_all_next || $hesk_settings['update_from'] == '3.2.0') {
// Fix any missing HTML messages from merged tickets
hesk_dbQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."replies` SET `message_html` = `message` WHERE `message_html` IS NULL");
$update_all_next = 1;
Klemen
Site Admin
Posts: 10141
Joined: Fri Feb 11, 2005 4:04 pm

Re: Mysql error updating from 3.2.3 to 3.4.3

Post by Klemen »

No, it detects the database version as 3.2.0 because you have the hesk_log_overdue table (see lines 1782 - 1786). The minor versions (3.2.1, 3.2.2, 3.2.3...) are ignored because there were no DB changes.

You can try changing

Code: Select all

if ($update_all_next || $hesk_settings['update_from'] == '2.8.3') {
to

Code: Select all

if (1 == 2) {
to skip that part, but it shouldn't be called in any case if the database you claim you have is indeed there.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
drzoom
Posts: 9
Joined: Tue Apr 25, 2023 11:06 am

Re: Mysql error updating from 3.2.3 to 3.4.3

Post by drzoom »

Changing that in the update.php file makes the update run ok.

But when trying to login to admin panel it gives this error:

Error
Can't execute SQL
Klemen
Site Admin
Posts: 10141
Joined: Fri Feb 11, 2005 4:04 pm

Re: Mysql error updating from 3.2.3 to 3.4.3

Post by Klemen »

Try this:

- backup Hesk files and database
- download hesk_settings.inc.php from the server
- find

Code: Select all

$hesk_settings['debug_mode']=0;
inside and change it to

Code: Select all

$hesk_settings['debug_mode']=1;
- save and upload the modified settings file to the server
- try to login

What does the error say now?
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
drzoom
Posts: 9
Joined: Tue Apr 25, 2023 11:06 am

Re: Mysql error updating from 3.2.3 to 3.4.3

Post by drzoom »

Here is the error I get:

Code: Select all

Error

Can't execute SQL: UPDATE `hesk_users` SET `pass`='xxxxxxxx' WHERE `id`=1

MySQL said:
Data too long for column 'pass' at row 1


WARNING
Debug mode is enabled. Make sure you disable debug mode in settings once HESK is installed and working properly.

Klemen
Site Admin
Posts: 10141
Joined: Fri Feb 11, 2005 4:04 pm

Re: Mysql error updating from 3.2.3 to 3.4.3

Post by Klemen »

It looks like your database is a mixture of tables from different versions.

This probably happened when after a failed update, an old backup was imported, but the newly generated tables were not deleted before running the update script again.

What I would so is:
1. make another backup
2. delete ALL the database tables
3. import the last working database backup you had (the one before running the update script the first time)
4. run the update script again

If that doesn't work, the only thing that remains is:
- install a clean copy of 3.4.3 somewhere
- manually compare each of your tables to clean 3.4.3 install, and edit all the fields to match the 3.4.3 database
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
drzoom
Posts: 9
Joined: Tue Apr 25, 2023 11:06 am

Re: Mysql error updating from 3.2.3 to 3.4.3

Post by drzoom »

I finally got it to work doing this:

- Rename column "message_html" to "message_html_old" in these tables: (_tickets, _reply_drafts,_replies,_std_replies,ticket_templates)
- Run the update script.
- Rename column "message_html_old" back to "message_html"


Thanks for your support.
Klemen
Site Admin
Posts: 10141
Joined: Fri Feb 11, 2005 4:04 pm

Re: Mysql error updating from 3.2.3 to 3.4.3

Post by Klemen »

Glad to hear you got it working!
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Post Reply