Answers.Body: <p>Backup and Migrate module may not be compatible with CiviCRM, and may not understand how to handle the many foreign key constraints within CiviCRM.</p>
  
  <p>Here is the easy way:</p>
  
  <ol>
  <li><p>Drop the database entirely (back it up first please)</p></li>
  <li><p>recreate that database with the same name</p></li>
  <li><p>then restore from your backup.</p></li>
  </ol>
  
  <p>Here is the hard way:
  Particularly, if a failed update has altered the table structure of your database, simply restoring may not work with any tool, because the schema has changed. More information:
  <a href="http://wiki.civicrm.org/confluence/display/CRMDOC/Ensuring+Schema+Integrity+on+Upgrades" rel="nofollow">http://wiki.civicrm.org/confluence/display/CRMDOC/Ensuring+Schema+Integrity+on+Upgrades</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-09T05:16:54.297Z
Answers.Text: Thank you. That was easy, the BAM module had me consumed for hours. This was a few minutes. Thanks so much. My version of PHPMyadmin had an import feature which made it very easy.
Answers.UserDisplayName: Hock
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-09T00:19:23.620Z
Answers.LastActivityDate: 2015-11-09T00:19:23.620Z
Answers.UserDisplayName: CiviTeacher
Body: <p>I have tried to use backup and migrate from an existing system into a fresh Bitnami Drupal 7.4.1 Civicrm 4.6.9 install on another machine. Win10
  BandM 7.x-3.1
  I received the following error:
  PDOException: SQLSTATE[23000]: Integrity constraint violation: 1217 Cannot delete or update a parent row: a foreign key constraint fails in backup_migrate_source_db_mysql->_restore_db_from_file() (line 199 of C:\Bitnami\civicrm-4.6.9-1\apps\civicrm\htdocs\sites\all\modules\backup_migrate\includes\sources.db.mysql.inc)
  I looked at the existing answers and am unable to get it to work.
  Please help.</p>
  
Tags: <backups>
Title: backup and migrate Cannot delete or update a parent row: a foreign key constraint fails
ThreadText: # backup and migrate Cannot delete or update a parent row: a foreign key constraint fails
  
  (Asked by: username_0 on 2015-11-08)
  
  I have tried to use backup and migrate from an existing system into a fresh Bitnami Drupal 7.4.1 Civicrm 4.6.9 install on another machine. Win10
  BandM 7.x-3.1
  I received the following error:
  PDOException: SQLSTATE[23000]: Integrity constraint violation: 1217 Cannot delete or update a parent row: a foreign key constraint fails in backup\_migrate\_source\_db\_mysql->\_restore\_db\_from\_file() (line 199 of C:\Bitnami\civicrm-4.6.9-1\apps\civicrm\htdocs\sites\all\modules\backup\_migrate\includes\sources.db.mysql.inc)
  I looked at the existing answers and am unable to get it to work.
  Please help.
  
  **Tags:** backups
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-11-09. Score: 1
  
  Backup and Migrate module may not be compatible with CiviCRM, and may not understand how to handle the many foreign key constraints within CiviCRM.
  
  Here is the easy way:
  
  1. Drop the database entirely (back it up first please)
  2. recreate that database with the same name
  3. then restore from your backup.
  
  Here is the hard way:
  Particularly, if a failed update has altered the table structure of your database, simply restoring may not work with any tool, because the schema has changed. More information:
  <http://wiki.civicrm.org/confluence/display/CRMDOC/Ensuring+Schema+Integrity+on+Upgrades>
  
  > **Comments:**
  > **username_0**: Thank you. That was easy, the BAM module had me consumed for hours. This was a few minutes. Thanks so much. My version of PHPMyadmin had an import feature which made it very easy.  
  
  ---
  
  