Answers.Body: <p><strong>How to revert the CiviCRM to previous state:</strong></p>
  
  <ol>
  <li>Put Drupal into maintenance mode</li>
  <li>Disable integration modules</li>
  <li>Replace <code>civicrm.settings.php</code> with backed up copy and check permissions</li>
  <li>Remove everything in <code>&lt;drupal_home&gt;/sites/all/modules/civicrm</code> and
  replace with backed up version and check permissions</li>
  <li><p>Drop civicrm database and import backup database</p></li>
  <li><p>Clear caches and empty <code>&lt;drupal_home&gt;sites/default/files/civicrm/templates_c</code> and check permissions</p></li>
  <li><p>Re-enable integration modules</p></li>
  <li>Log in, test and debug</li>
  </ol>
  
  <p><strong>Command Line Cheatsheet for Drush and MySQL, Regarding These Steps:</strong></p>
  
  <p>Maintenance mode: <code>drush vset maintenance_mode 1</code></p>
  
  <p>Disabling and Enabling CiviCRM Integration Modules: </p>
  
  <p><code>drush pm-disable [integration_module]</code> or
  <code>drush pm-enable [integration_module]</code></p>
  
  <p>Dropping, re-creating and importing a database in MySQL:</p>
  
  <pre><code>mysql -u [username] -p
  use [database name];
  DROP DATABASE [database];
  CREATE DATABASE [database];
  source path/to/backup.sql;
  </code></pre>
  
  <p>Clear caches: <code>drush cc all</code></p>
  
  <p>Dealing with templates_c: <code>rm &lt;drupal_home&gt;sites/default/files/civicrm/templates_c/*</code></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-28T06:11:42.163Z
Answers.LastActivityDate: 2016-12-29T16:33:03.970Z
Answers.LastEditDate: 2016-12-29T16:33:03.970Z
Answers.UserDisplayName: Christia
Body: <p>What is the best procedure for reverting the CiviCRM, powered by Drupal 7, back to a previous backed up state, in case of database corruption, failed upgrades or other undesirable changes?</p>
  
Tags: <drupal><backups>
Title: Reverting CiviCRM on Drupal 7 to last backed up state?
ThreadText: # Reverting CiviCRM on Drupal 7 to last backed up state?
  
  (Asked by: username_0 on 2016-12-28)
  
  What is the best procedure for reverting the CiviCRM, powered by Drupal 7, back to a previous backed up state, in case of database corruption, failed upgrades or other undesirable changes?
  
  **Tags:** drupal, backups
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2016-12-28. Score: 4 | Accepted answer
  
  How to revert the CiviCRM to previous state:
  
  Put Drupal into maintenance mode
  Disable integration modules
  Replace civicrm.settings.php with backed up copy and check permissions
  Remove everything in /sites/all/modules/civicrm and
  replace with backed up version and check permissions
  Drop civicrm database and import backup database
  Clear caches and empty sites/default/files/civicrm/templates_c and check permissions
  Re-enable integration modules
  Log in, test and debug
  
  Command Line Cheatsheet for Drush and MySQL, Regarding These Steps:
  Maintenance mode: drush vset maintenance_mode 1
  Disabling and Enabling CiviCRM Integration Modules: 
  drush pm-disable [integration_module] or
  drush pm-enable [integration_module]
  Dropping, re-creating and importing a database in MySQL:
  mysql -u [username] -p
  use [database name];
  DROP DATABASE [database];
  CREATE DATABASE [database];
  source path/to/backup.sql;
  
  Clear caches: drush cc all
  Dealing with templates_c: rm sites/default/files/civicrm/templates_c/*
  
  
  ---
  
  