DB Tables emails and emails_text safe to empty

You can delete from the DB but you need to be careful not to leave any “hanging threads”.

Start by understanding the relationships between the tables.

This is how I’d do it. I would go in emails_text table and choose a row that I want to delete. Take a note of the row’s id field.

Now, in phpMyAdmin,

  • choose the database (not a single table, select the whole database) and
  • choose Search from the top menu.
  • type the id in the search box
  • in the box with all the table names, select all of them (click the first one and press ctrl-shift-end)
  • press the “Go” button to search

This will let you see where that id is referenced in the database. You will probably find a entry in the emails table. I think you should grab the row id of that one, and repeat the process, to find out which beans are related to that email.

You can automate all this in SQL statements.

It won’t be tragic if you leave a few relationships hanging around, pointing to email records that no longer exist. In fact, SuiteCRM systems typically have tons of these left-overs. but if it’s a lot of stuff you might want to keep things tidy.