How do I best delete bulk records in 7.2 Professional?

We've been doing some testing of importing of Accounts, Contacts, and Leads into our SugarCRM install. We need to do a hard delete on all records we imported plus any related data (I do not know what this covers)

It would be nice to have a near clean working database again with nothing we imported. Has anyone had this requirement and have a good solution to the problem?


I've used the sql below but is it enough?

# Removing leads import
TRUNCATE TABLE leads;
TRUNCATE TABLE leads_audit;
TRUNCATE TABLE leads_cstm;
TRUNCATE TABLE prospect_lists_prospects;

# Removing Contacts import
TRUNCATE TABLE contacts;
TRUNCATE TABLE contacts_audit;
TRUNCATE TABLE contacts_bugs;
TRUNCATE TABLE contacts_cases;
TRUNCATE TABLE contacts_cstm;
TRUNCATE TABLE contacts_users;

I would like to be able to remove as much junk as possible without breaking anything.

  • What is it that you are running this SQL in?  You could use phpMyAdmin and then that would show you other tables that have data in them.  Just shy away from truncating tables with non-module names like 'config' or 'relationships'.

  • Truncating tables removes EVERYTHING from those tables, is that really what you are wanting to do?

    Are you trying to start with a clean Sugar instance without any data?