On Sat, Dec 10, 2022 at 9:45 PM Mark Sapiro <mark@msapiro.net> wrote:
On 12/10/22 01:13, Odhiambo Washington wrote:
On Thu, Dec 8, 2022 at 10:41 PM Mark Sapiro <mark@msapiro.net> wrote:
In the DATABASES['default'] definition, you need to set
'OPTIONS': {'charset': 'utf8mb4'}
I added that:
[database] class: mailman.database.mysql.MySQLDatabase url: mysql+pymysql://mailman_user:XXXXXXXXX@localhost /mailmansuite?charset=utf8mb4&use_unicode=1
The above is for Mailman core. It doesn't affect HyperKitty. For that you need to look at the DATABASES definition in /etc/mailman3/settings.py < https://docs.mailman3.org/projects/mailman-web/en/latest/settings.html#mailman_web.settings.base.DATABASES>
and ensure that in addition to the other settings under
default {
you have'OPTIONS': {'charset': 'utf8mb4'},
...
You might also need to modify the tables, particularly hyperkitty_email with something like
ALTER TABLE hyperkitty_email DEFAULT CHARACTER SET utf8mb4, MODIFY subject varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, MODIFY content CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
So I removed my list, dropped the database, and proceeded as follows:
create database mailmansuite CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE hyperkitty_email DEFAULT CHARACTER SET utf8mb4; ALTER TABLE hyperkitty_email MODIFY subject varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE hyperkitty_email MODIFY content longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE hyperkitty_email MODIFY sender_name varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE hyperkitty_email MODIFY in_reply_to varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
I did all those (although looks overzealous) just to be on the safe side. I have seen people putting emojis in their names.
None of that should be necessary.
mailman-web migrate
should create the database and tables as needed.After that, I did the mailman-web migrate, created the list, imported the config from MM2 and then proceeded to import the archives. However, the errors still are there, and several messages were not imported
Do you have the OPTIONS setting in your DATABASES definition in settings.py?
Here is what I have tested lately in settings.py:
# MySQL Database setup DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'mailmansuite', 'USER': 'mm3', 'PASSWORD': 'XXXXXXXXX', 'HOST': 'localhost', 'PORT': '', 'OPTIONS': { 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'", 'charset': 'utf8mb4', }, } }
I have dropped the DB, recreated, run the 'migrate', created the list, imported config from MM2. However, nothing seems to be able to address the errors with importing the archives.
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)