Hi @xmoxx69
This “Duplicate entry ‘0’ for key ‘PRIMARY'” error, combined with the plugin becoming unusable right after reactivation, points to a database issue rather than a plugin files issue. Reinstalling MailPoet only replaces the plugin’s code, it doesn’t touch the data already stored in your MailPoet database tables, so if one of those tables has a corrupted or duplicated row, the same error will keep appearing no matter how many times you reinstall.
Here’s how to resolve it:
- Back up your subscribers and newsletters first. Go to MailPoet > Subscribers and export your lists to CSV, and note down or export any newsletters or automations you want to keep. See this guide for more detail: How to Migrate MailPoet Database Tables (https://kb.mailpoet.com/article/377-how-to-migrate-mailpoet-database-tables)
- Once you have your data backed up, go to MailPoet > Settings > Advanced tab, and use the “Reinstall from scratch” option. This removes and rebuilds all of MailPoet’s database tables from a clean state, which clears out the corrupted row causing the primary key conflict. You can find details on this option here: Settings > The Advanced Tab (https://kb.mailpoet.com/article/138-the-advanced-tab)
Please note this action is irreversible and will remove all existing MailPoet data (subscribers, lists, newsletters, settings), so the backup in step 1 is important before proceeding.
- After the reinstall completes, re-import your subscriber lists from the CSV you exported.
This should let MailPoet initialize cleanly without hitting the existing corrupted table data. Let us know how it goes.