Answers.Body: <p>Try doing the migration after emptying (dropping all the tables) the DB for the clean install of CiviCRM (so that there is no data or structure in the DB for CiviCRM). I have not had any issues doing an import of my CiviCRM DB into a fresh DB. </p>
  
  <p>I do a full DB dump and don't bother ignoring any tables. Before exporting your CiviCRM DB clean all the caches (drush cc civicrm). Then simply do a mysqldump -u user -p mycivicb > civicrm_db.sql</p>
  
  <p>Clear the cache after import (civicrm and drupal). Initially you will get a bunch of errors when loading the page. You'll need to setup your directories and resource urls again. Clear cache whenever you have problems after changing a setting...</p>
  
  <p>Let me know if this works for you. It is a pretty quick process to see if it does...</p>
  
  <p>Note: I usually do a full dump of the drupal and civicrm DBs and import those.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-10T15:08:10.523Z
Answers.LastActivityDate: 2016-10-10T15:08:10.523Z
Answers.UserDisplayName: Sleewok
Answers.Body: <p>Thanks Sleewok - just before i got your response - i solved it by doing the following:
  In mysql file there is reference of old username
  /<em>!50017 DEFINER=<code>genie_drp71</code>@<code>localhost</code></em>/</p>
  
  <p>I googled for this issue and
  this links tells to delete all  instances of above and then upload
  <a href="https://forum.civicrm.org/index.php?topic=29659.0" rel="nofollow">https://forum.civicrm.org/index.php?topic=29659.0</a></p>
  
  <p>So I cleaned my db, archived it again and imported into a fresh db on my new server and it WORKED !</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-12T07:50:33.610Z
Answers.LastActivityDate: 2016-10-12T07:50:33.610Z
Answers.UserDisplayName: Ratnesh Mathur
Body: <p>I am shifting my server for my DRUPAL7 + Civicrm website.
  I followed the process outlined <a href="https://wiki.civicrm.org/confluence/display/CRMDOC/Alternate+Moving+the+database+using+phpMyAdmin" rel="nofollow noreferrer">here</a></p>
  <p>I have the drupal site working fine and a fresh install of Civicrm working fine. Now i just need to transfer my data from old server to new. When i try to import the data - i get following MySQL error</p>
  <p>Error
  SQL query:</p>
  <p>CREATE TABLE IF NOT EXISTS <code>civicrm_acl</code> ( <code>id</code> int(10) unsigned NOT NULL COMMENT 'Unique table ID', <code>name</code> varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'ACL Name.', <code>deny</code> tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Is this ACL entry Allow (0) or Deny (1) ?', <code>entity_table</code> varchar(64) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Table of the object possessing this ACL entry (Contact, Group, or ACL Group)', <code>entity_id</code> int(10) unsigned DEFAULT NULL COMMENT 'ID of the object possessing this ACL', <code>operation</code> varchar(8) COLLATE utf8_unicode_ci NOT NULL COMMENT 'What operation does this ACL entry control?', <code>object_table</code> varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'The table of the object controlled by this ACL entry', <code>object_id</code> int(10) unsigned DEFAULT NULL COMMENT 'The ID of the object controlled by this ACL entry', <code>acl_table</code> varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'If this is a grant/revoke entry, what table are we granting?[...]</p>
  <p>MySQL said:
  1215 - Cannot add foreign key constraint</p>
  <p>pl help.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-10-07T10:58:30.963Z
Comments.Text: Please follow the below link for moving Civicrm DB - https://wiki.civicrm.org/confluence/display/CRMDOC/Moving+an+Existing+Installation+to+a+New+Server+or+Location
Comments.UserDisplayName: Ramesh - ARTECH Consultancy
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-10-07T17:42:21.357Z
Comments.Text: Thanks Ramesh - actually the link given by you also I used when doing the transfer and more and less both the pages (incidentally written by same person) tell the same thing. The instructions say to transfer the databse after leaving out 5 tables - which I am dong  - yet - I am getting the error at that step - I have taken care of all the previous steps
Comments.UserDisplayName: Ratnesh Mathur
Tags: <drupal><mysql><migration>
Title: MySQL errors when transferring database from one server to another
ThreadText: # MySQL errors when transferring database from one server to another
  
  (Asked by: username_0 on 2016-10-07)
  
  I am shifting my server for my DRUPAL7 + Civicrm website.
  I followed the process outlined [here](https://wiki.civicrm.org/confluence/display/CRMDOC/Alternate+Moving+the+database+using+phpMyAdmin)
  
  I have the drupal site working fine and a fresh install of Civicrm working fine. Now i just need to transfer my data from old server to new. When i try to import the data - i get following MySQL error
  
  Error
  SQL query:
  
  CREATE TABLE IF NOT EXISTS `civicrm_acl` ( `id` int(10) unsigned NOT NULL COMMENT 'Unique table ID', `name` varchar(64) COLLATE utf8\_unicode\_ci DEFAULT NULL COMMENT 'ACL Name.', `deny` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Is this ACL entry Allow (0) or Deny (1) ?', `entity_table` varchar(64) COLLATE utf8\_unicode\_ci NOT NULL COMMENT 'Table of the object possessing this ACL entry (Contact, Group, or ACL Group)', `entity_id` int(10) unsigned DEFAULT NULL COMMENT 'ID of the object possessing this ACL', `operation` varchar(8) COLLATE utf8\_unicode\_ci NOT NULL COMMENT 'What operation does this ACL entry control?', `object_table` varchar(64) COLLATE utf8\_unicode\_ci DEFAULT NULL COMMENT 'The table of the object controlled by this ACL entry', `object_id` int(10) unsigned DEFAULT NULL COMMENT 'The ID of the object controlled by this ACL entry', `acl_table` varchar(64) COLLATE utf8\_unicode\_ci DEFAULT NULL COMMENT 'If this is a grant/revoke entry, what table are we granting?[...]
  
  MySQL said:
  1215 - Cannot add foreign key constraint
  
  pl help.
  
  **Tags:** drupal, mysql, migration
  
  > **Comments:**
  > **username_1**: Please follow the below link for moving Civicrm DB - https://wiki.civicrm.org/confluence/display/CRMDOC/Moving+an+Existing+Installation+to+a+New+Server+or+Location  
  > **username_0**: Thanks Ramesh - actually the link given by you also I used when doing the transfer and more and less both the pages (incidentally written by same person) tell the same thing. The instructions say to transfer the databse after leaving out 5 tables - which I am dong  - yet - I am getting the error at that step - I have taken care of all the previous steps  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2016-10-10. Score: 1
  
  Try doing the migration after emptying (dropping all the tables) the DB for the clean install of CiviCRM (so that there is no data or structure in the DB for CiviCRM). I have not had any issues doing an import of my CiviCRM DB into a fresh DB.
  
  I do a full DB dump and don't bother ignoring any tables. Before exporting your CiviCRM DB clean all the caches (drush cc civicrm). Then simply do a mysqldump -u user -p mycivicb > civicrm\_db.sql
  
  Clear the cache after import (civicrm and drupal). Initially you will get a bunch of errors when loading the page. You'll need to setup your directories and resource urls again. Clear cache whenever you have problems after changing a setting...
  
  Let me know if this works for you. It is a pretty quick process to see if it does...
  
  Note: I usually do a full dump of the drupal and civicrm DBs and import those.
  
  
  ---
  
  ### Answer by username_0 on 2016-10-12. Score: 0
  
  Thanks username_2 - just before i got your response - i solved it by doing the following:
  In mysql file there is reference of old username
  /*!50017 DEFINER=`genie_drp71`@`localhost`*/
  
  I googled for this issue and
  this links tells to delete all instances of above and then upload
  <https://forum.civicrm.org/index.php?topic=29659.0>
  
  So I cleaned my db, archived it again and imported into a fresh db on my new server and it WORKED !
  
  
  ---
  
  