Answers.Body: <p>Typically, bots contacts/contributions will follow some standard method of populating information - e.g. a recent bot attack on one of our clients created contacts with "%phone_short%" listed as their main phone number, so using search builder in the GUI allowed me to identify all associated spam contacts and delete them permanently. </p>
  
  <p>If these spam contacts are associated with contributions, you'll need to delete the contributions before you are able to permanently delete the contacts - you can isolate those contributions by creating a group from the search builder results, then use Contributions > Find Contributions to search for and delete all contributions made by contacts in your spam group.</p>
  
  <p>Depending on your payment processor, you may have contributions with a status of "Failed" - if so, you can search for all failed contributions (I would do this search using Search > Advanced Search with Display Results as "Contributions"). Review the list to see if you get any legitimately failed contributions associated with legitimate contacts - if you do, narrow the results further by entering a received date and time range since spam contributions are typically created in rapid succession. Once you've isolated the spam contributions, run the same same search, only this time with Display Results as "Contacts", then create a group of these contacts - this will allow you to isolate the spam contacts for permanent deletion after you have deleted the contributions.</p>
  
  <p>With the above tips, you may be able to stick with the existing database and avoid the need to transfer recurring contributions, but if not, I would suggest creating new recurring contributions since migrating existing ones could prove to be very time consuming and complicated given the many different tables in which contribution information is stored, e.g.:</p>
  
  <ol>
  <li>Records in civicrm_contribution_recur are associated with a specific civicrm_contact.id</li>
  <li>Records in civicrm_contribution are associated with a specific civicrm_contribution_recur.id</li>
  <li><p>Records in civicrm_contribution are associated with several other tables, many of which are interconnected with IDs from yet other tables - e.g.:</p>
  
  <p>3.1. civicrm_financial_type > civicrm_financial_acount > civicrm_entity_financial_acount</p>
  
  <p>3.2. civicrm_contribution.id > civicrm_line_item.id</p>
  
  <p>3.3. civicrm_line_item.id > civicrm_financial_item.id</p>
  
  <p>3.4. civicrm_entity_financial_trxn > civicrm_contribution > civicrm_financial_item.id > civicrm_financial_trxn</p>
  
  <p>3.5. civicrm_contribution_id > civicrm_contribution_page.id</p>
  
  <p>3.6. civicrm_contribution_id > civicrm_event.id > civicrm_participant.id > civicrm_participant_payment.id</p></li>
  </ol>
  
  <p>Keep in mind, the above may not be an exhaustive list, and you would most definitely want to do this directly in the database so that you can preserve all of the existing IDs.</p>
  
  <p>Hope this helps,
  Tamar</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-16T20:56:33.477Z
Answers.Text: Thanks for your reply! I will see if I can remove the bots first. otherwise seems quiet complicated
Answers.UserDisplayName: Tapash
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-16T20:24:35.787Z
Answers.LastActivityDate: 2019-05-16T20:29:55.330Z
Answers.LastEditDate: 2019-05-16T20:29:55.330Z
Answers.UserDisplayName: Tamar Meir - Cividesk
Body: <p>Our database was handled very roughly over last couple of years and tested features recklessly. Mixed events payments with contribution payments etc. Numerous price sets. Bot attack was also another problem until recaptcha implemented. We dont even know how many contact &amp; contribution was populated by bots.</p>
  
  <p>What I am trying is to export all contact data only with potential donors, contribution, and events data. Not bothered about activities. And import it onto a clean instance of Civicrm. Another concern we have is recurring paypal donations. After moving how can we keep those linked to contacts?</p>
  
  <p>Any suggestion would be much appreciated. Thanks</p>
  
Tags: <export><data-import>
Title: How can I export Contact Contribution and event data?
ThreadText: # How can I export Contact Contribution and event data?
  
  (Asked by: username_0 on 2019-05-14)
  
  Our database was handled very roughly over last couple of years and tested features recklessly. Mixed events payments with contribution payments etc. Numerous price sets. Bot attack was also another problem until recaptcha implemented. We dont even know how many contact & contribution was populated by bots.
  
  What I am trying is to export all contact data only with potential donors, contribution, and events data. Not bothered about activities. And import it onto a clean instance of Civicrm. Another concern we have is recurring paypal donations. After moving how can we keep those linked to contacts?
  
  Any suggestion would be much appreciated. Thanks
  
  **Tags:** export, data-import
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-05-16. Score: 2 | Accepted answer
  
  Typically, bots contacts/contributions will follow some standard method of populating information - e.g. a recent bot attack on one of our clients created contacts with "%phone\_short%" listed as their main phone number, so using search builder in the GUI allowed me to identify all associated spam contacts and delete them permanently.
  
  If these spam contacts are associated with contributions, you'll need to delete the contributions before you are able to permanently delete the contacts - you can isolate those contributions by creating a group from the search builder results, then use Contributions > Find Contributions to search for and delete all contributions made by contacts in your spam group.
  
  Depending on your payment processor, you may have contributions with a status of "Failed" - if so, you can search for all failed contributions (I would do this search using Search > Advanced Search with Display Results as "Contributions"). Review the list to see if you get any legitimately failed contributions associated with legitimate contacts - if you do, narrow the results further by entering a received date and time range since spam contributions are typically created in rapid succession. Once you've isolated the spam contributions, run the same same search, only this time with Display Results as "Contacts", then create a group of these contacts - this will allow you to isolate the spam contacts for permanent deletion after you have deleted the contributions.
  
  With the above tips, you may be able to stick with the existing database and avoid the need to transfer recurring contributions, but if not, I would suggest creating new recurring contributions since migrating existing ones could prove to be very time consuming and complicated given the many different tables in which contribution information is stored, e.g.:
  
  1. Records in civicrm\_contribution\_recur are associated with a specific civicrm\_contact.id
  2. Records in civicrm\_contribution are associated with a specific civicrm\_contribution\_recur.id
  3. Records in civicrm\_contribution are associated with several other tables, many of which are interconnected with IDs from yet other tables - e.g.:
  
     3.1. civicrm\_financial\_type > civicrm\_financial\_acount > civicrm\_entity\_financial\_acount
  
     3.2. civicrm\_contribution.id > civicrm\_line\_item.id
  
     3.3. civicrm\_line\_item.id > civicrm\_financial\_item.id
  
     3.4. civicrm\_entity\_financial\_trxn > civicrm\_contribution > civicrm\_financial\_item.id > civicrm\_financial\_trxn
  
     3.5. civicrm\_contribution\_id > civicrm\_contribution\_page.id
  
     3.6. civicrm\_contribution\_id > civicrm\_event.id > civicrm\_participant.id > civicrm\_participant\_payment.id
  
  Keep in mind, the above may not be an exhaustive list, and you would most definitely want to do this directly in the database so that you can preserve all of the existing IDs.
  
  Hope this helps,
  username_1
  
  > **Comments:**
  > **username_0**: Thanks for your reply! I will see if I can remove the bots first. otherwise seems quiet complicated  
  
  ---
  
  