Mautic Community Forums

How to shrink Bloated MySQL db?

Sent 4 messages to a contact list of 16,467.



SiteGround host informs me that I’ve exceeded allowable MySQL database size of 750MB.



How can I shrink that? I tried setting Table “email_stats” column “copy_id” to null, but foreign key restraint prohibits modification of that data.



I don’t care about stats after the second week since sending. What is the best/easiest method to reduce that database size?

Sent 4 messages to a contact list of 16,467.

SiteGround host informs me that I’ve exceeded allowable MySQL database size of 750MB.

How can I shrink that? I tried setting Table “email_stats” column “copy_id” to null, but foreign key restraint prohibits modification of that data.

I don’t care about stats after the second week since sending. What is the best/easiest method to reduce that database size?

Have you tried this, from https://mautic.org/docs/en/setup/cron_jobs.html

[quote]Cleanup Old Data

Cleanup a Mautic installation by purging old data. Note that not all data is able to be purged. Currently supported are audit log entries, visitors (anonymous contacts), and visitor page hits. Use --dry-run to view the number of records to be purged before making any changes.

This will permanently delete data! Be sure to keep database backups.[/quote]

php /path/to/mautic/app/console mautic:maintenance:cleanup --days-old=365 --dry-run

No, I haven’t, because that’s not where the whopping gobs of data in question are stored. There’s a copy of every single message - not just a reference to the original, but the entire message for every recipient—thousands of them, archived for individual tracking purposes. I tried to clear that data manually from the database: Table “email_stats”; column “copy_id” but there is a foreign key restraint on that data. Can’t seem to drop the column, either.

How can I delete that specific data, or achieve the same result, without destroying any dependencies or else wise screwing other things up?

+1