Bug 8132 - Database Migration: PostgreSQL to MariaDB
Summary: Database Migration: PostgreSQL to MariaDB
Status: NEW
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: spamassassin (show other bugs)
Version: 4.0.0
Hardware: PC Linux
: P2 normal
Target Milestone: Undefined
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-26 09:52 UTC by Andreas
Modified: 2023-05-26 09:52 UTC (History)
0 users



Attachment Type Modified Status Actions Submitter/CLA Status

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas 2023-05-26 09:52:43 UTC
It is currently not possible to perform a database migration 
from PostgreSQL to MariaDB.

Option A:
- sa-learn --backup > backup.db
- change local.cf to use MariaDB
- sa-learn --restore backup.db

The import takes ages but is incomplete.

Option B:
- pg_dump --inserts spamassassin > dump_postgres.sql
- cat dump_postgres.sql | grep "INSERT INTO" > dump_mysql.sql
- sed -i 's/INSERT INTO public./INSERT INTO /' dump_mysql.sql
- mysql -D spamassassin -u spamassassin -p < dump_mysql.sql

ERROR 1406 (22001) at line 7106628: Data too long for column 'token' at row 1.

Is there a solution for this?