Answers.Body: <p>Two issues.  1. Database is getting reset when you upgrade  2. you cannot restore from backup.</p>
  
  <p>Answer to #1 is this: Make sure you are following the upgrade procedure on
  this page: <a href="http://wiki.civicrm.org/confluence/display/CRMDOC/Installation+and+Upgrades" rel="nofollow">http://wiki.civicrm.org/confluence/display/CRMDOC/Installation+and+Upgrades</a></p>
  
  <p>Answer to #2 is this, before restoring from backup, follow this procedure.</p>
  
  <p>a. ensure that the backup is intact, examine in a text editor, or import the backup into an entirely new database (not the civicrm database) called "justtesting" or whatever</p>
  
  <p>b. drop the civicrm database.  this resets the schema of the database entirely, as new tables and columns are added during partial/failed upgrades, and must be removed.</p>
  
  <p>c. recreate the civicrm database with the same name as it had before</p>
  
  <p>d. import the mysql backup dump file into the newly re-created civicrm database.  </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-16T22:26:15.290Z
Answers.LastActivityDate: 2015-07-17T15:31:21.340Z
Answers.LastEditDate: 2015-07-17T15:31:21.340Z
Answers.UserDisplayName: CiviTeacher
Body: <p>I tried to upgrade from Civi version 4.6.3 to 4.6.4 but ended up having my crm database erased and filled with an empty civi database. I have tried to import my backup sql file in phpMyAdmin and get the following error.</p>
  
  <pre><code>--
  -- Dumping data for table `civicrm_acl`
  --
  
  INSERT INTO `civicrm_acl` (`id`, `name`, `deny`, `entity_table`, `entity_id`, `operation`, `object_table`, `object_id`, `acl_table`, `acl_id`, `is_active`) VALUES
  (1, 'Edit All Contacts', 0, 'civicrm_acl_role', 1, 'Edit', 'civicrm_saved_search', 0, NULL, NULL, 1),
  (2, 'Core ACL', 0, 'civicrm_acl_role', 0, 'All', 'access CiviMail subscribe/unsubscribe pages', NULL, NULL, NULL, 1),
  (3, 'Core ACL', 0, 'civicrm_acl_role', 0, 'All', 'access all custom data', NULL, NULL, NULL, 1),
  (4, 'Core ACL', 0, 'civicrm_acl_role', 0, 'All', 'make online contributions', NULL, NULL, NULL, 1),
  (5, 'Core ACL', 0, 'civicrm_acl_role', 0, 'All', 'make online pledges', NULL, NULL, NULL, 1),
  (6, 'Core ACL', 0, 'civicrm_acl_role', 0, 'All', 'profile listings and forms', NULL, NULL, NULL, 1),
  (7, 'Core ACL', 0, 'civicrm_acl_role', 0, 'All', 'view event info', NULL, NULL, NULL, 1),
  (8, 'Core ACL', 0, 'civicrm_acl_role', 0, 'All', 'register for events', NULL, NULL, NU[...]
  MySQL said: Documentation
  
  #1062 - Duplicate entry '1' for key 'PRIMARY' 
  </code></pre>
  
Tags: <upgrade><mysql>
Title: Civi Database erased when upgrading from 4.6.3 to 4.6.4
ThreadText: # Civi Database erased when upgrading from 4.6.3 to 4.6.4
  
  (Asked by: username_0 on 2015-07-16)
  
  I tried to upgrade from Civi version 4.6.3 to 4.6.4 but ended up having my crm database erased and filled with an empty civi database. I have tried to import my backup sql file in phpMyAdmin and get the following error.
  --
  -- Dumping data for table `civicrm_acl`
  --
  
  INSERT INTO `civicrm_acl` (`id`, `name`, `deny`, `entity_table`, `entity_id`, `operation`, `object_table`, `object_id`, `acl_table`, `acl_id`, `is_active`) VALUES
  (1, 'Edit All Contacts', 0, 'civicrm_acl_role', 1, 'Edit', 'civicrm_saved_search', 0, NULL, NULL, 1),
  (2, 'Core ACL', 0, 'civicrm_acl_role', 0, 'All', 'access CiviMail subscribe/unsubscribe pages', NULL, NULL, NULL, 1),
  (3, 'Core ACL', 0, 'civicrm_acl_role', 0, 'All', 'access all custom data', NULL, NULL, NULL, 1),
  (4, 'Core ACL', 0, 'civicrm_acl_role', 0, 'All', 'make online contributions', NULL, NULL, NULL, 1),
  (5, 'Core ACL', 0, 'civicrm_acl_role', 0, 'All', 'make online pledges', NULL, NULL, NULL, 1),
  (6, 'Core ACL', 0, 'civicrm_acl_role', 0, 'All', 'profile listings and forms', NULL, NULL, NULL, 1),
  (7, 'Core ACL', 0, 'civicrm_acl_role', 0, 'All', 'view event info', NULL, NULL, NULL, 1),
  (8, 'Core ACL', 0, 'civicrm_acl_role', 0, 'All', 'register for events', NULL, NULL, NU[...]
  MySQL said: Documentation
  
  #1062 - Duplicate entry '1' for key 'PRIMARY'
  
  **Tags:** upgrade, mysql
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-07-16. Score: 5
  
  Two issues. 1. Database is getting reset when you upgrade 2. you cannot restore from backup.
  
  Answer to #1 is this: Make sure you are following the upgrade procedure on
  this page: <http://wiki.civicrm.org/confluence/display/CRMDOC/Installation+and+Upgrades>
  
  Answer to #2 is this, before restoring from backup, follow this procedure.
  
  a. ensure that the backup is intact, examine in a text editor, or import the backup into an entirely new database (not the civicrm database) called "justtesting" or whatever
  
  b. drop the civicrm database. this resets the schema of the database entirely, as new tables and columns are added during partial/failed upgrades, and must be removed.
  
  c. recreate the civicrm database with the same name as it had before
  
  d. import the mysql backup dump file into the newly re-created civicrm database.
  
  
  ---
  
  