0

I am shifting my server for my DRUPAL7 + Civicrm website. I followed the process outlined here

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.

  • Please follow the below link for moving Civicrm DB - wiki.civicrm.org/confluence/display/CRMDOC/… – Ramesh - ARTECH Consultancy Oct 7 '16 at 10:58
  • 1
    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 – Ratnesh Mathur Oct 7 '16 at 17:42
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.

0

Thanks Sleewok - 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 !

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.