CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Error on DB Upgrade with 2.1 Alpha Release
Pages: 1 [2]

Author Topic: Error on DB Upgrade with 2.1 Alpha Release  (Read 15759 times)

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: Error on DB Upgrade with 2.1 Alpha Release
September 22, 2008, 07:15:27 am
here are my other screenshots (forum wasn't letting me put them together)

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: Error on DB Upgrade with 2.1 Alpha Release
September 22, 2008, 07:16:00 am
3rd one

Deepak Srivastava

  • Moderator
  • Ask me questions
  • *****
  • Posts: 677
  • Karma: 65
Re: Error on DB Upgrade with 2.1 Alpha Release
September 22, 2008, 07:41:31 am
emily,

Quote
   [debug_info] => ALTER TABLE `civicrm_acl_entity_role` DROP FOREIGN KEY `FK_civicrm_acl_entity_role_domain_id` [nativecode=1025 ** Error on rename of './cctvcivicrm_v2/civicrm_acl_entity_role' to './cctvcivicrm_v2/#sql2-6cb-c7e3' (errno: 152)]

The error message shows that the problem is now with "civicrm_acl_entity_role" table and NOT "civicrm_acl". So you might wanna try same fixes you tried for 'civicrm_acl' table.
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: Error on DB Upgrade with 2.1 Alpha Release
September 22, 2008, 08:04:27 am
Deepak,

Oh yeah - duh. Thanks....so I ran your query again but this time for civicrm_acl_entity_role table instead. Upon doing so, I get this mysql error:
Code: [Select]
ALTER TABLE `civicrm_acl_entity_role` ADD CONSTRAINT `FK_civicrm_acl_domain_id` FOREIGN KEY ( `domain_id` ) REFERENCES `civicrm_domain` ( `id` )

MySQL said: Documentation
#1005 - Can't create table './cctvcivicrm_v2/#sql-6cb_c81b.frm' (errno: 121)

appears to be the same kind of error that the upgrade is giving me. here's a screenshot of my civicrm_acl_entity_role table.

Deepak Srivastava

  • Moderator
  • Ask me questions
  • *****
  • Posts: 677
  • Karma: 65
Re: Error on DB Upgrade with 2.1 Alpha Release
September 22, 2008, 10:45:55 am
Could you send me your valid 2.0 db to deepak at webaccess.co.in and we'll have a look.
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: Error on DB Upgrade with 2.1 Alpha Release
September 24, 2008, 09:35:09 am
OK, thanks to some big help from Deepak, this is all sorted out.

Essentially, my 2.0 db was corrupted, and even though it looked like it had all the correct FK constraints, it didn't. Because there were too many to fix manually we had to reload my whole db into a properly structured 2.0 db. Here are the steps we followed:

1. Dumped all of the data only from my db
2. I had some custom value fields in my db (custom value tables start with civicrm_value_), and since a new CiviCRM 2.0 database wouldn't have these tables, I needed to dump just the structure of my custom value tables. i did not dump the structure for any other tables.
3. I created a new, empty database
4. Import civicrm/sql/civicrm.mysql into my empty database from CiviCRM 2.0 (NOT 2.1). This gave me the correct 2.0 database structure.
5. Imported my structure dump from step 2 into my new database.
6. Ran the following query on my new database to add a column that existed at one point in 2.0 but no longer does. Without this step, the next step was failing for me.
Code: [Select]
ALTER TABLE civicrm_group_contact ADD loc_block_id int(10) unsigned default NULL;7. Imported the data dump from step 1 to my new database. This gives me a correct 2.0 database with all of my data in it.
8. Ran the upgrade script, which completed successfully.
9. Ran the following query to remove the column I added in step 6:
Code: [Select]
ALTER TABLE `civicrm_group_contact`
  DROP `loc_block_id`;

10. Followed the rest of the Drupal upgrade to 2.1 instructions to complete the upgrade.

Jim Clark

  • I’m new here
  • *
  • Posts: 9
  • Karma: 0
Re: Error on DB Upgrade with 2.1 Alpha Release
September 26, 2008, 09:00:19 am
Wow, thanks for the post.

I had been going nuts trying to upgrade.

I just followed your the steps in your database example on a Joomla upgrade and it worked perfectly.

polestar

  • I post frequently
  • ***
  • Posts: 162
  • Karma: 11
    • Target Integration
Re: Error on DB Upgrade with 2.1 Alpha Release
December 04, 2008, 03:26:27 am
Hi Emily,

When I am trying to do step 7 its giving me following error.

Code: [Select]
#1452 - Cannot add or update a child row: a foreign key constraint fails (`imtaDataNew/civicrm_activity`, CONSTRAINT `FK_civicrm_activity_source_contact_id` FOREIGN KEY (`source_contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)
I am updating 2.0 to 2.1.2 stable.

Can you please help.

Thanks
CiviCRM - Installation & Support | Virtual Private Servers (VPS) with Joomla/Drupal and CiviCRM | SugarCRM & vTiger CRM Installation and Support
Target Integration | www.targetintegration.com
Subscribe to Knowledgement - Your guide to effective business | http://www.knowledgement.ie

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: Error on DB Upgrade with 2.1 Alpha Release
December 15, 2008, 09:21:03 am
i'm not sure i have the answer since this upgrade procedure is supposed to specifically deal with fk issues. did you try the regular upgrade first? do you have any other info about the previous steps? no issues before step 7? why are you following this thread in the first place (assuming you have had some of the same issues, but post your details so we can help you more).

also read lobo's comment above about making sure you aren't trying these steps after an already-failed upgrade...


polestar

  • I post frequently
  • ***
  • Posts: 162
  • Karma: 11
    • Target Integration
Re: Error on DB Upgrade with 2.1 Alpha Release
December 16, 2008, 07:09:53 am
Thanks Emily,

Got the problem resolved through some professional services.

CiviCRM - Installation & Support | Virtual Private Servers (VPS) with Joomla/Drupal and CiviCRM | SugarCRM & vTiger CRM Installation and Support
Target Integration | www.targetintegration.com
Subscribe to Knowledgement - Your guide to effective business | http://www.knowledgement.ie

Pages: 1 [2]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Error on DB Upgrade with 2.1 Alpha Release

This forum was archived on 2017-11-26.