<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi Guys,</p>
<p>I have created php script to reset CRM Database. But i have
create some custom extra tables. so you can remove those one. <br>
</p>
<p><br>
</p>
<div class="moz-cite-prefix">On 6/28/19 2:40 PM, nilay khatri wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAFJh29xZuPMDFSiV+8x+V8Y=C3fH8fjtYyBRh=6bx+K8k-BKvw@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">Also, delete the users.
<div><br>
</div>
<div>Sharing and User privileges files from the user_privileges
folder.</div>
<div><br>
</div>
<div>Files from Storage folder, cache, templates_c.</div>
<div><br>
</div>
<div>Delete email configuration from vtiger_systems table.</div>
<div><br>
</div>
<div><br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Thu, Jun 27, 2019 at 7:45
PM VTE <<a href="mailto:support@vtexperts.com"
moz-do-not-send="true">support@vtexperts.com</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Start with:<br>
<br>
update vtiger_crmentity set deleted='1';<br>
truncate vtiger_crmentity;<br>
<br>
and run the below:<br>
<br>
### Delete<br>
<br>
<br>
DELETE FROM `vtiger_account` WHERE accountid NOT IN (SELECT
crmid FROM<br>
vtiger_crmentity);<br>
DELETE FROM `vtiger_accountbillads` WHERE accountaddressid NOT
IN (SELECT<br>
crmid FROM vtiger_crmentity);<br>
DELETE FROM `vtiger_accountscf` WHERE accountid NOT IN (SELECT
crmid FROM<br>
vtiger_crmentity);<br>
DELETE FROM `vtiger_accountshipads` WHERE accountaddressid NOT
IN (SELECT<br>
crmid FROM vtiger_crmentity);<br>
<br>
### Contacts<br>
<br>
DELETE FROM `vtiger_contactaddress` WHERE contactaddressid NOT
IN (SELECT<br>
crmid FROM vtiger_crmentity);<br>
DELETE FROM `vtiger_contactdetails` WHERE contactid NOT IN
(SELECT crmid<br>
FROM vtiger_crmentity);<br>
DELETE FROM `vtiger_contactscf` WHERE contactid NOT IN (SELECT
crmid FROM<br>
vtiger_crmentity);<br>
DELETE FROM `vtiger_contactsubdetails` WHERE
contactsubscriptionid NOT IN<br>
(SELECT crmid FROM vtiger_crmentity);<br>
<br>
### Leads<br>
<br>
DELETE FROM `vtiger_leadsubdetails` WHERE leadsubscriptionid
NOT IN (SELECT<br>
crmid FROM vtiger_crmentity);<br>
DELETE FROM `vtiger_leadaddress` WHERE leadaddressid NOT IN
(SELECT crmid<br>
FROM vtiger_crmentity);<br>
DELETE FROM `vtiger_leadscf` WHERE leadid NOT IN (SELECT crmid
FROM<br>
vtiger_crmentity);<br>
DELETE FROM `vtiger_leaddetails` WHERE leadid NOT IN (SELECT
crmid FROM<br>
vtiger_crmentity);<br>
<br>
<br>
<br>
### Services<br>
DELETE FROM vtiger_service WHERE serviceid NOT IN (SELECT
crmid FROM<br>
vtiger_crmentity);<br>
DELETE FROM vtiger_servicecf WHERE serviceid NOT IN (SELECT
crmid FROM<br>
vtiger_crmentity);<br>
<br>
### products<br>
<br>
DELETE FROM vtiger_products WHERE productid NOT IN (SELECT
crmid FROM<br>
vtiger_crmentity);<br>
DELETE FROM vtiger_productcf WHERE productid NOT IN (SELECT
crmid FROM<br>
vtiger_crmentity);<br>
<br>
## sales orders<br>
DELETE FROM `vtiger_salesorder` WHERE salesorderid NOT IN
(SELECT crmid FROM<br>
vtiger_crmentity);<br>
DELETE FROM `vtiger_salesordercf` WHERE salesorderid NOT IN
(SELECT crmid<br>
FROM vtiger_crmentity);<br>
DELETE FROM `vtiger_sobillads` WHERE sobilladdressid NOT IN
(SELECT crmid<br>
FROM vtiger_crmentity);<br>
DELETE FROM `vtiger_soshipads` WHERE soshipaddressid NOT IN
(SELECT crmid<br>
FROM vtiger_crmentity);<br>
DELETE FROM `vtiger_inventoryproductrel` WHERE id NOT IN
(SELECT crmid FROM<br>
vtiger_crmentity);<br>
<br>
### Activity<br>
<br>
DELETE FROM vtiger_activity WHERE activityid NOT IN (SELECT
crmid FROM<br>
vtiger_crmentity);<br>
DELETE FROM `vtiger_activitycf` WHERE activityid NOT IN
(SELECT crmid FROM<br>
vtiger_crmentity);<br>
DELETE FROM `vtiger_activity_reminder` WHERE activity_id NOT
IN (SELECT<br>
crmid FROM vtiger_crmentity);<br>
DELETE FROM `vtiger_emaildetails` WHERE emailid NOT IN (SELECT
crmid FROM<br>
vtiger_crmentity);<br>
<br>
<br>
#comments<br>
DELETE FROM vtiger_modcomments WHERE modcommentsid NOT IN
(SELECT crmid FROM<br>
vtiger_crmentity);<br>
DELETE FROM `vtiger_modcommentscf` WHERE modcommentsid NOT IN
(SELECT crmid<br>
FROM vtiger_crmentity);<br>
<br>
<br>
# assets<br>
<br>
DELETE FROM vtiger_assets WHERE assetsid NOT IN (SELECT crmid
FROM<br>
vtiger_crmentity);<br>
DELETE FROM `vtiger_assetscf` WHERE assetsid NOT IN (SELECT
crmid FROM<br>
vtiger_crmentity);<br>
<br>
# invoice<br>
DELETE FROM vtiger_invoice WHERE invoiceid NOT IN (SELECT
crmid FROM<br>
vtiger_crmentity);<br>
DELETE FROM `vtiger_invoicecf` WHERE invoiceid NOT IN (SELECT
crmid FROM<br>
vtiger_crmentity);<br>
<br>
# sc<br>
<br>
DELETE FROM vtiger_servicecontracts WHERE servicecontractsid
NOT IN (SELECT<br>
crmid FROM vtiger_crmentity);<br>
DELETE FROM `vtiger_servicecontractscf` WHERE
servicecontractsid NOT IN<br>
(SELECT crmid FROM vtiger_crmentity);<br>
<br>
# Oppts<br>
DELETE FROM vtiger_potential WHERE potentialid NOT IN (SELECT
crmid FROM<br>
vtiger_crmentity);<br>
DELETE FROM vtiger_potentialscf WHERE potentialid NOT IN
(SELECT crmid FROM<br>
vtiger_crmentity);<br>
<br>
# Leads<br>
DELETE FROM vtiger_leaddetails WHERE leadid NOT IN (SELECT
crmid FROM<br>
vtiger_crmentity);<br>
DELETE FROM vtiger_leadsubdetails WHERE leadsubscriptionid NOT
IN (SELECT<br>
crmid FROM vtiger_crmentity);<br>
DELETE FROM vtiger_leadaddress WHERE leadaddressid NOT IN
(SELECT crmid FROM<br>
vtiger_crmentity);<br>
DELETE FROM vtiger_leadscf WHERE leadid NOT IN (SELECT crmid
FROM<br>
vtiger_crmentity);<br>
<br>
# misc<br>
<br>
DELETE FROM vtiger_notes WHERE notesid NOT IN (SELECT crmid
FROM<br>
vtiger_crmentity);<br>
DELETE FROM vtiger_troubletickets WHERE ticketid NOT IN
(SELECT crmid FROM<br>
vtiger_crmentity);<br>
DELETE FROM vtiger_ticketcf WHERE ticketid NOT IN (SELECT
crmid FROM<br>
vtiger_crmentity);<br>
DELETE FROM vtiger_products WHERE productid NOT IN (SELECT
crmid FROM<br>
vtiger_crmentity);<br>
DELETE FROM vtiger_faq WHERE id NOT IN (SELECT crmid FROM
vtiger_crmentity);<br>
DELETE FROM vtiger_activity WHERE activityid NOT IN (SELECT
crmid FROM<br>
vtiger_crmentity);<br>
DELETE FROM vtiger_vendor WHERE vendorid NOT IN (SELECT crmid
FROM<br>
vtiger_crmentity);<br>
DELETE FROM vtiger_pricebook WHERE pricebookid NOT IN (SELECT
crmid FROM<br>
vtiger_crmentity);<br>
DELETE FROM vtiger_quotes WHERE quoteid NOT IN (SELECT crmid
FROM<br>
vtiger_crmentity);<br>
DELETE FROM vtiger_account WHERE accountid NOT IN (SELECT
crmid FROM<br>
vtiger_crmentity);<br>
DELETE FROM vtiger_purchaseorder WHERE purchaseorderid NOT IN
(SELECT crmid<br>
FROM vtiger_crmentity);<br>
DELETE FROM vtiger_salesorder WHERE salesorderid NOT IN
(SELECT crmid FROM<br>
vtiger_crmentity);<br>
DELETE FROM vtiger_account WHERE accountid NOT IN (SELECT
crmid FROM<br>
vtiger_crmentity);<br>
DELETE FROM vtiger_invoice WHERE invoiceid NOT IN (SELECT
crmid FROM<br>
vtiger_crmentity);<br>
DELETE FROM vtiger_invoicecf WHERE invoiceid NOT IN (SELECT
crmid FROM<br>
vtiger_crmentity);<br>
DELETE FROM vtiger_campaign WHERE campaignid NOT IN (SELECT
crmid FROM<br>
vtiger_crmentity);<br>
DELETE FROM vtiger_pbxmanager WHERE pbxmanagerid NOT IN
(SELECT crmid FROM<br>
vtiger_crmentity);<br>
DELETE FROM vtiger_servicecontracts WHERE servicecontractsid
NOT IN (SELECT<br>
crmid FROM vtiger_crmentity);<br>
DELETE FROM vtiger_servicecontractscf WHERE servicecontractsid
NOT IN<br>
(SELECT crmid FROM vtiger_crmentity);<br>
DELETE FROM vtiger_service WHERE serviceid NOT IN (SELECT
crmid FROM<br>
vtiger_crmentity);<br>
DELETE FROM vtiger_servicecf WHERE serviceid NOT IN (SELECT
crmid FROM<br>
vtiger_crmentity);<br>
DELETE FROM vtiger_assets WHERE assetsid NOT IN (SELECT crmid
FROM<br>
vtiger_crmentity);<br>
DELETE FROM vtiger_assetscf WHERE assetsid NOT IN (SELECT
crmid FROM<br>
vtiger_crmentity);<br>
DELETE FROM vtiger_projectmilestone WHERE projectmilestoneid
NOT IN (SELECT<br>
crmid FROM vtiger_crmentity);<br>
DELETE FROM vtiger_projectmilestonecf WHERE projectmilestoneid
NOT IN<br>
(SELECT crmid FROM vtiger_crmentity);<br>
DELETE FROM vtiger_projecttask WHERE projecttaskid NOT IN
(SELECT crmid FROM<br>
vtiger_crmentity);<br>
DELETE FROM vtiger_projecttaskcf WHERE projecttaskid NOT IN
(SELECT crmid<br>
FROM vtiger_crmentity);<br>
DELETE FROM vtiger_project WHERE projectid NOT IN (SELECT
crmid FROM<br>
vtiger_crmentity);<br>
DELETE FROM vtiger_projectcf WHERE projectid NOT IN (SELECT
crmid FROM<br>
vtiger_crmentity);<br>
<br>
#custom<br>
<br>
DELETE FROM `vtiger_listings` WHERE listingsid NOT IN (SELECT
crmid FROM<br>
vtiger_crmentity);<br>
DELETE FROM `vtiger_listingscf` WHERE listingsid NOT IN
(SELECT crmid FROM<br>
vtiger_crmentity);<br>
<br>
<br>
<br>
<br>
<br>
-----<br>
VTExperts<br>
--<br>
Sent from: <a
href="http://vtiger-crm.2324883.n4.nabble.com/vtigercrm-developers-f4.html"
rel="noreferrer" target="_blank" moz-do-not-send="true">http://vtiger-crm.2324883.n4.nabble.com/vtigercrm-developers-f4.html</a><br>
_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer"
target="_blank" moz-do-not-send="true">http://www.vtiger.com/</a><br>
</blockquote>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
<a class="moz-txt-link-freetext" href="http://www.vtiger.com/">http://www.vtiger.com/</a></pre>
</blockquote>
</body>
</html>