Roundcube Community Forum

 

Upgrade roundcube version mysql problem Duplicate entry

Started by itiloo, April 26, 2023, 09:16:46 AM

Previous topic - Next topic

itiloo

Hi:
I am upgrading from 1.4.13 to 1.5.3
I have mysql 8.

Copying files to target location....htaccess.new
done.

NOTICE: New .htaccess file saved as .htaccess.new.

Running update script at target...
Executing database schema update.
ERROR: Error in DDL upgrade 2020020101: [1062] Duplicate entry 'xxxxxxxx@xxxxxxxxx' for key 'users.username'
Updating database schema (2020020101)... [FAILED]
All done.

In the ./SQL/mysql/2020020101.sql file, this sentence do that error:
"ALTER TABLE `users` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"

I see in mysql username table, duplicates same entries, one in lowercase and other in uppercase, by users which login in roundcube sometimes with lowercase others with uppercase.

Any solution?.

Thanks.



JohnDoh

you need to clean up your users table, remove the duplicates.

you might also look at setting

// Forces conversion of logins to lower case.
// 0 - disabled, 1 - only domain part, 2 - domain and local part.
// If users authentication is case-insensitive this must be enabled.
// Note: After enabling it all user records need to be updated, e.g. with query:
//       UPDATE users SET username = LOWER(username);
$config['login_lc'] = 2;

in your rounducbe config to prevent the situation in the future.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

itiloo