Page 1 of 1

Update does not update database correctly

Posted: Thu Oct 13, 2022 12:13 pm
by xxak
Script URL: not public
Version of script: 3.4.1
Hosting company: own
URL of phpinfo.php: not public
URL of session_test.php: not public (OK: PHP sessions work fine.)
What terms did you try when SEARCHING for a solution: update, upgrade, executing

Write your message below:

Hi, I am testing update to latest version, going from 3.1.2 to 3.4.1, everything seems fine, but after finishing the update I get this error:

Can't execute SQL: UPDATE `hesk_users` SET `pass`='$REDACTEDBUTLONGENOUGH' WHERE `id`=1
MySQL said:
Data too long for column 'pass' at row 1

I tried the upgrade (hesk31x_to_341), and the full version updater. When I increase the length of hesk_user.pass I get other errors, like missing due_date etc... Tables are created (e.g. mfa, oauth...) but existing seem not to be changed... Thank you.

Re: Update does not update database correctly

Posted: Thu Oct 13, 2022 12:23 pm
by Klemen
My update of 3.1.2 to 3.4.1 goes smoothly.

Column pass length is updated when updating 3.2.x to 3.3.0 - not sure why that didn't happen in your case. Maybe you had other incomplete upgrades or customizations?

What I would do is:

1. restore the databse from your backup
2. make sure you have 100% original Hesk 3.4.1 files, including the install folder
3. make sure you have no other tables in the Hesk database other than original Hesk 3.1.2 tables
4. run the update script again

Re: Update does not update database correctly

Posted: Fri Oct 14, 2022 6:20 am
by xxak
As far as I can tell I have no modifications or customizations other than a logo. And I did exactly what you wrote several times before writing here, even re-downloaded all files, restored DB from my oldest backup (half a year old). Result is always the same, new tables are created but old are not updated. There is no log of this upgrade process, is it? I will try upgrade to 3.3.0 and see what happens...

Re: Update does not update database correctly

Posted: Fri Oct 14, 2022 6:58 am
by xxak
Upgrade to 3.3.0 pointed me to a problem - I already had auth_tokens table in DB (probably from first failed upgrade test - that was my fault with wrong path in hesk_settings.inc.php, DB backup is without --add-drop-database .... *facepalm* ), so the setup script had a problem with existing tables and refused to continue, I recreated the database from scratch and now everything seems OK. Nevertheless, the upgrade script to 3.4.1 did not produce any obvious errors, which confused me... Now let's get to finishing the czech translation...

Thank you.

Re: Update does not update database correctly

Posted: Fri Oct 14, 2022 9:22 am
by Klemen
If you had the auth_tokens in the database, then the update script detected your version as being 3.3.x instead of 3.1.x, so it was never properly updated.

Glad to hear you got it working now.