AnsweredAssumed Answered

How to safely clean upload directory ?

Question asked by Gaelle Fernandez on May 18, 2016

Hello everyone,

 

I'm asking a really big question (but it shouldn't be since Sugar should've thought about this after all this time struggling with upload directory) :

How to safely clean my upload directory ?

 

In my customer's case, we want to copy our Sugar installation to another server. So, we'll have to make a tar.gz of our application, and a mysqldump of our database. But my upload directory is way too heavy (circa 2+Gb). So, i would like to know how to erase the upload directory safely.

For your information,we clean the database like this :

 

TRUNCATE TABLE accounts; TRUNCATE TABLE accounts_audit; TRUNCATE TABLE accounts_bugs; TRUNCATE TABLE accounts_cases; TRUNCATE TABLE accounts_contacts; TRUNCATE TABLE accounts_cstm; TRUNCATE TABLE accounts_opportunities; TRUNCATE TABLE activities; TRUNCATE TABLE activities_users; TRUNCATE TABLE calls; TRUNCATE TABLE calls_contacts; TRUNCATE TABLE calls_cstm; TRUNCATE TABLE calls_leads; TRUNCATE TABLE calls_users; TRUNCATE TABLE cases; TRUNCATE TABLE cases_audit; TRUNCATE TABLE cases_cstm; TRUNCATE TABLE contacts; TRUNCATE TABLE contacts_audit; TRUNCATE TABLE contacts_bugs; TRUNCATE TABLE contacts_cases; TRUNCATE TABLE contacts_cases_1_c; TRUNCATE TABLE contacts_contracts_1_c; TRUNCATE TABLE contacts_cstm; TRUNCATE TABLE contacts_users; TRUNCATE TABLE contracts; TRUNCATE TABLE contracts_audit; TRUNCATE TABLE contracts_cases_1_c; TRUNCATE TABLE contracts_contacts; TRUNCATE TABLE contracts_cstm; TRUNCATE TABLE email_addr_bean_rel; TRUNCATE TABLE email_addresses; TRUNCATE TABLE email_cache; TRUNCATE TABLE email_marketing; TRUNCATE TABLE email_marketing_prospect_lists; TRUNCATE TABLE email_templates; TRUNCATE TABLE leads; TRUNCATE TABLE leads_audit; TRUNCATE TABLE leads_cstm; TRUNCATE TABLE notes; TRUNCATE TABLE tasks;

 

So every email is erased.

How to erase the Email's files in database AND in upload directory ?

How to erase all the files resulting of an import via the import wizard ?

Well, how to clean the upload directory safely ?

 

Thanks a lot for your tricks and answers !

Outcomes