Answers.Body: <p>Two answers:</p>
  
  <p>Do you have <a href="https://civicrm.stackexchange.com/questions/12492/how-do-i-turn-on-detailed-logging">detailed logging</a> eanabled?  If no, then no - you can restore a backup of your database (to a test site) and copy the data out.</p>
  
  <p>If you have advanced logging enabled: you can use SQL.  You need to know the ID of the deleted mailing - you can check the titles with <code>SELECT DISTINCT id, name FROM log_civicrm_mailing</code>.  </p>
  
  <p>Once you find the ID number, substitute the <code>X</code> at the end of this query for the ID.</p>
  
  
  
  <pre><code>INSERT INTO civicrm_mailing (id, domain_id, header_id, footer_id, reply_id, unsubscribe_id, resubscribe_id, optout_id, name, mailing_type, from_name, from_email, replyto_email, subject, body_text, body_html, url_tracking, forward_replies, auto_responder, open_tracking, is_completed, msg_template_id, override_verp, created_id, created_date, scheduled_id, scheduled_date, approver_id, approval_date, approval_status_id, approval_note, is_archived, visibility, campaign_id, dedupe_email, sms_provider_id, hash, location_type_id, email_selection_method, language, template_type, template_options, modified_date) SELECT id, domain_id, header_id, footer_id, reply_id, unsubscribe_id, resubscribe_id, optout_id, name, mailing_type, from_name, from_email, replyto_email, subject, body_text, body_html, url_tracking, forward_replies, auto_responder, open_tracking, is_completed, msg_template_id, override_verp, created_id, created_date, scheduled_id, scheduled_date, approver_id, approval_date, approval_status_id, approval_note, is_archived, visibility, campaign_id, dedupe_email, sms_provider_id, hash, location_type_id, email_selection_method, language, template_type, template_options, modified_date 
  FROM log_civicrm_mailing WHERE log_action = 'Delete' AND id = X;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-03-12T14:50:42.210Z
Answers.LastActivityDate: 2020-03-12T14:50:42.210Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>Is there any way to restore a mailing after you delete it? Or even find it?</p>
  
  <p>We are using CiviCRM 5.8.12 with WordPress. We use Mosaico for some mailings.</p>
  
Tags: <civimail><deleted>
Title: Restore a deleted mailing?
ThreadText: # Restore a deleted mailing?
  
  (Asked by: username_0 on 2020-03-11)
  
  Is there any way to restore a mailing after you delete it? Or even find it?
  
  We are using CiviCRM 5.8.12 with WordPress. We use Mosaico for some mailings.
  
  **Tags:** civimail, deleted
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-03-12. Score: 2
  
  Two answers:
  
  Do you have [detailed logging](https://civicrm.stackexchange.com/questions/12492/how-do-i-turn-on-detailed-logging) eanabled? If no, then no - you can restore a backup of your database (to a test site) and copy the data out.
  
  If you have advanced logging enabled: you can use SQL. You need to know the ID of the deleted mailing - you can check the titles with `SELECT DISTINCT id, name FROM log_civicrm_mailing`.
  
  Once you find the ID number, substitute the `X` at the end of this query for the ID.
  
  ```
  INSERT INTO civicrm_mailing (id, domain_id, header_id, footer_id, reply_id, unsubscribe_id, resubscribe_id, optout_id, name, mailing_type, from_name, from_email, replyto_email, subject, body_text, body_html, url_tracking, forward_replies, auto_responder, open_tracking, is_completed, msg_template_id, override_verp, created_id, created_date, scheduled_id, scheduled_date, approver_id, approval_date, approval_status_id, approval_note, is_archived, visibility, campaign_id, dedupe_email, sms_provider_id, hash, location_type_id, email_selection_method, language, template_type, template_options, modified_date) SELECT id, domain_id, header_id, footer_id, reply_id, unsubscribe_id, resubscribe_id, optout_id, name, mailing_type, from_name, from_email, replyto_email, subject, body_text, body_html, url_tracking, forward_replies, auto_responder, open_tracking, is_completed, msg_template_id, override_verp, created_id, created_date, scheduled_id, scheduled_date, approver_id, approval_date, approval_status_id, approval_note, is_archived, visibility, campaign_id, dedupe_email, sms_provider_id, hash, location_type_id, email_selection_method, language, template_type, template_options, modified_date 
  FROM log_civicrm_mailing WHERE log_action = 'Delete' AND id = X;
  
  ```
  
  
  ---
  
  