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) »
  • Upgrading 4.0.7-> 4.1.1 Error on rename of './dbname/civicrm_pcp_block
Pages: [1]

Author Topic: Upgrading 4.0.7-> 4.1.1 Error on rename of './dbname/civicrm_pcp_block  (Read 3735 times)

SemperFi

  • I post frequently
  • ***
  • Posts: 177
  • Karma: 3
  • CiviCRM version: 4.5.4
  • CMS version: Wordpress 4.0.1
  • MySQL version: MySQL 5.5.16
  • PHP version: PHP 5.3.17
Upgrading 4.0.7-> 4.1.1 Error on rename of './dbname/civicrm_pcp_block
March 18, 2012, 09:36:52 am
Hello,

I'm facing this issue when trying to execute the /civicrm/upgrade?reset=1 - I'm migrating from civi 4.0.7 to 4.1.1 on a Drupal 7.12 installation.
Could you please advise how to solve the problem ?

Can I use the 4.1.1 installation even if the upgrade script didn't go to its end ?
Thanks in advance

---------------------------------
DB Error: unknown error
Error Details
Database Error Code: Error on rename of './dbname/civicrm_pcp_block' to './dbname/#sql2-30f2-5b9d' (errno: 152), 1025
Additional Details:

Array
(
    [callback] => Array
        (
           
  • => CRM_Core_Error
  • [1] => handle
            )

       
Code: [Select]
=> -1
    [message] => DB Error: unknown error
    [mode] => 16
    [debug_info] => ALTER TABLE civicrm_pcp_block
      DROP FOREIGN KEY FK_civicrm_pcp_block_entity_id,
      DROP INDEX FK_civicrm_pcp_block_entity_id [nativecode=1025 ** Error on rename of './dbname/civicrm_pcp_block' to './dbname/#sql2-30f2-5b9d' (errno: 152)]
    [type] => DB_Error
    [user_info] => ALTER TABLE civicrm_pcp_block
      DROP FOREIGN KEY FK_civicrm_pcp_block_entity_id,
      DROP INDEX FK_civicrm_pcp_block_entity_id [nativecode=1025 ** Error on rename of './dbname/civicrm_pcp_block' to './dbname/#sql2-30f2-5b9d' (errno: 152)]
    [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info="ALTER TABLE civicrm_pcp_block
      DROP FOREIGN KEY FK_civicrm_pcp_block_entity_id,
      DROP INDEX FK_civicrm_pcp_block_entity_id [nativecode=1025 ** Error on rename of './dbname/civicrm_pcp_block' to './dbname/#sql2-30f2-5b9d' (errno: 152)]"]
)
« Last Edit: March 18, 2012, 10:17:24 am by SemperFi »

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Upgrading 4.0.7-> 4.1.1 Error on rename of './dbname/civicrm_pcp_block
March 18, 2012, 12:26:17 pm
See http://forum.civicrm.org/index.php?topic=23837.new
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

SemperFi

  • I post frequently
  • ***
  • Posts: 177
  • Karma: 3
  • CiviCRM version: 4.5.4
  • CMS version: Wordpress 4.0.1
  • MySQL version: MySQL 5.5.16
  • PHP version: PHP 5.3.17
Re: Upgrading 4.0.7-> 4.1.1 Error on rename of './dbname/civicrm_pcp_block
March 20, 2012, 03:03:49 am
Hi !
I was able to run this request from my phpadmin interface : ALTER TABLE `civicrm_pcp_block` DROP INDEX `FK_civicrm_pcp_block_entity_id` and it worked well.
But then I ran the update (.../civicrm/upgrade?reset=1) and it failed :

DB Error: not found
Error Details
Database Error Code: Can't DROP 'FK_civicrm_pcp_block_entity_id'; check that column/key exists, 1091
Additional Details: ...

Can I remove this FK manually, using phpmyadmin, and then delete this code in the sql update file, to be able to run it again ? - which file should I edit to find this request ?
Thanks

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Upgrading 4.0.7-> 4.1.1 Error on rename of './dbname/civicrm_pcp_block
March 20, 2012, 04:09:29 am
Quote from: SemperFi on March 20, 2012, 03:03:49 am
Can I remove this FK manually, using phpmyadmin, and then delete this code in the sql update file, to be able to run it again ? - which file should I edit to find this request ?
Thanks

Yes you can do that. I don't know which file offhand but you can simply search the source code for that MySQL query to find it.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

SemperFi

  • I post frequently
  • ***
  • Posts: 177
  • Karma: 3
  • CiviCRM version: 4.5.4
  • CMS version: Wordpress 4.0.1
  • MySQL version: MySQL 5.5.16
  • PHP version: PHP 5.3.17
Re: Upgrading 4.0.7-> 4.1.1 Error on rename of './dbname/civicrm_pcp_block
March 20, 2012, 08:45:21 am
OK great - Can you precise "search the source code for that MySQL query" / which file is/are called when lauching the update process, or in which folder would I be able to find it ?

Searching in all the source code could be very long regarding the number of files...

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Upgrading 4.0.7-> 4.1.1 Error on rename of './dbname/civicrm_pcp_block
March 20, 2012, 08:48:24 am
Took me 3 seconds to search:

Code: [Select]
$ grep -r 'ALTER TABLE civicrm_pcp_block' *
CRM/Upgrade/Incremental/sql/4.1.alpha1.mysql.tpl:ALTER TABLE civicrm_pcp_block
CRM/Upgrade/Incremental/sql/4.1.0.mysql.tpl:      ALTER TABLE civicrm_pcp_block ADD link_text_{$locale} varchar(255);
CRM/Upgrade/Incremental/sql/4.1.0.mysql.tpl:  ALTER TABLE civicrm_pcp_block DROP link_text;

That means it's in CRM/Upgrade/Incremental/sql
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

SemperFi

  • I post frequently
  • ***
  • Posts: 177
  • Karma: 3
  • CiviCRM version: 4.5.4
  • CMS version: Wordpress 4.0.1
  • MySQL version: MySQL 5.5.16
  • PHP version: PHP 5.3.17
Re: Upgrading 4.0.7-> 4.1.1 Error on rename of './dbname/civicrm_pcp_block
March 20, 2012, 02:36:53 pm
In the file /sites/all/modules/civicrm/CRM/Upgrade/Incremental/sql4.1.alpha1.mysql.tpl,  I commented these lines :

-- CRM-8534
-- ALTER TABLE civicrm_pcp_block
--      DROP FOREIGN KEY FK_civicrm_pcp_block_entity_id,
--      DROP INDEX FK_civicrm_pcp_block_entity_id;

-- ALTER TABLE civicrm_pcp
--      DROP FOREIGN KEY FK_civicrm_pcp_contribution_page_id,
--      DROP INDEX FK_civicrm_pcp_contribution_page_id;

and I removed manually the FK using phpmyadmin. Then I ran the update script and it worked perfectly ! Upgrade done !
Thanks a lot for your invaluable help !

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Upgrading 4.0.7-> 4.1.1 Error on rename of './dbname/civicrm_pcp_block
March 20, 2012, 02:42:01 pm
My pleasure. :)
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Prolineserver

  • I’m new here
  • *
  • Posts: 9
  • Karma: 0
  • CiviCRM version: 4.0.5
  • CMS version: Drupal 7.7
  • MySQL version: 5.1.49
  • PHP version: 5.0.51a-24+lenny5
Re: Upgrading 4.0.7-> 4.1.1 Error on rename of './dbname/civicrm_pcp_block
April 07, 2012, 12:03:13 am
See also this bug: http://issues.civicrm.org/jira/browse/CRM-9450

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Upgrading 4.0.7-> 4.1.1 Error on rename of './dbname/civicrm_pcp_block
December 01, 2014, 12:23:08 pm
See attached file for illustration to drop keys via PHPMyAdmin.

Also:
http://s3.postimg.org/52jkwv20j/this_is_how.png
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Upgrading 4.0.7-> 4.1.1 Error on rename of './dbname/civicrm_pcp_block

This forum was archived on 2017-11-26.