1

CiviCRM Upgrade Wordpress 4.4.5 to 4.7.10 DB Error: no such field.

Site shows at bottom of screens: Powered by CiviCRM 4.4.5

Trying to upgrade to 4.7.10 and after pressing Upgrade button CiviCRM just hangs with no action. Log file found shows the errors below:

Aug 14 10:05:12  [info] $Fatal Error Details = Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -19
    [message] => DB Error: no such field
    [mode] => 16
    [debug_info] => SELECT civicrm_custom_field.id as civicrm_custom_field_id, civicrm_custom_field.label as civicrm_custom_field_label, civicrm_custom_field.column_name as civicrm_custom_field_column_name, civicrm_custom_field.data_type as civicrm_custom_field_data_type, civicrm_custom_field.html_type as civicrm_custom_field_html_type, civicrm_custom_field.default_value as civicrm_custom_field_default_value, civicrm_custom_field.attributes as civicrm_custom_field_attributes, civicrm_custom_field.is_required as civicrm_custom_field_is_required, civicrm_custom_field.is_view as civicrm_custom_field_is_view, civicrm_custom_field.help_pre as civicrm_custom_field_help_pre, civicrm_custom_field.help_post as civicrm_custom_field_help_post, civicrm_custom_field.options_per_line as civicrm_custom_field_options_per_line, civicrm_custom_field.start_date_years as civicrm_custom_field_start_date_years, civicrm_custom_field.end_date_years as civicrm_custom_field_end_date_years, civicrm_custom_field.date_format as civicrm_custom_field_date_format, civicrm_custom_field.time_format as civicrm_custom_field_time_format, civicrm_custom_field.option_group_id as civicrm_custom_field_option_group_id, civicrm_custom_field.in_selector as civicrm_custom_field_in_selector, civicrm_custom_group.id as civicrm_custom_group_id, civicrm_custom_group.name as civicrm_custom_group_name, civicrm_custom_group.table_name as civicrm_custom_group_table_name, civicrm_custom_group.title as civicrm_custom_group_title, civicrm_custom_group.help_pre as civicrm_custom_group_help_pre, civicrm_custom_group.help_post as civicrm_custom_group_help_post, civicrm_custom_group.collapse_display as civicrm_custom_group_collapse_display, civicrm_custom_group.style as civicrm_custom_group_style, civicrm_custom_group.is_multiple as civicrm_custom_group_is_multiple, civicrm_custom_group.extends as civicrm_custom_group_extends, civicrm_custom_group.extends_entity_column_id as civicrm_custom_group_extends_entity_column_id, civicrm_custom_group.extends_entity_column_value as civicrm_custom_group_extends_entity_column_value, civicrm_custom_group.max_multiple as civicrm_custom_group_max_multiple 
FROM     civicrm_custom_group
LEFT JOIN civicrm_custom_field ON (civicrm_custom_field.custom_group_id = civicrm_custom_group.id)

WHERE civicrm_custom_group.is_active = 1
  AND civicrm_custom_field.is_active = 1
  AND civicrm_custom_group.extends IN ('Individual', 'Contact')
AND civicrm_custom_group.extends_entity_column_value IS NULL AND  ( 1 )  
ORDER BY civicrm_custom_group.weight,
         civicrm_custom_group.title,
         civicrm_custom_field.weight,
         civicrm_custom_field.label
 [nativecode=1054 ** Unknown column 'civicrm_custom_field.in_selector' in 'field list']
    [type] => DB_Error
    [user_info] => SELECT civicrm_custom_field.id as civicrm_custom_field_id, civicrm_custom_field.label as civicrm_custom_field_label, civicrm_custom_field.column_name as civicrm_custom_field_column_name, civicrm_custom_field.data_type as civicrm_custom_field_data_type, civicrm_custom_field.html_type as civicrm_custom_field_html_type, civicrm_custom_field.default_value as civicrm_custom_field_default_value, civicrm_custom_field.attributes as civicrm_custom_field_attributes, civicrm_custom_field.is_required as civicrm_custom_field_is_required, civicrm_custom_field.is_view as civicrm_custom_field_is_view, civicrm_custom_field.help_pre as civicrm_custom_field_help_pre, civicrm_custom_field.help_post as civicrm_custom_field_help_post, civicrm_custom_field.options_per_line as civicrm_custom_field_options_per_line, civicrm_custom_field.start_date_years as civicrm_custom_field_start_date_years, civicrm_custom_field.end_date_years as civicrm_custom_field_end_date_years, civicrm_custom_field.date_format as civicrm_custom_field_date_format, civicrm_custom_field.time_format as civicrm_custom_field_time_format, civicrm_custom_field.option_group_id as civicrm_custom_field_option_group_id, civicrm_custom_field.in_selector as civicrm_custom_field_in_selector, civicrm_custom_group.id as civicrm_custom_group_id, civicrm_custom_group.name as civicrm_custom_group_name, civicrm_custom_group.table_name as civicrm_custom_group_table_name, civicrm_custom_group.title as civicrm_custom_group_title, civicrm_custom_group.help_pre as civicrm_custom_group_help_pre, civicrm_custom_group.help_post as civicrm_custom_group_help_post, civicrm_custom_group.collapse_display as civicrm_custom_group_collapse_display, civicrm_custom_group.style as civicrm_custom_group_style, civicrm_custom_group.is_multiple as civicrm_custom_group_is_multiple, civicrm_custom_group.extends as civicrm_custom_group_extends, civicrm_custom_group.extends_entity_column_id as civicrm_custom_group_extends_entity_column_id, civicrm_custom_group.extends_entity_column_value as civicrm_custom_group_extends_entity_column_value, civicrm_custom_group.max_multiple as civicrm_custom_group_max_multiple 
FROM     civicrm_custom_group
LEFT JOIN civicrm_custom_field ON (civicrm_custom_field.custom_group_id = civicrm_custom_group.id)

WHERE civicrm_custom_group.is_active = 1
  AND civicrm_custom_field.is_active = 1
  AND civicrm_custom_group.extends IN ('Individual', 'Contact')
AND civicrm_custom_group.extends_entity_column_value IS NULL AND  ( 1 )  
ORDER BY civicrm_custom_group.weight,
         civicrm_custom_group.title,
         civicrm_custom_field.weight,
         civicrm_custom_field.label
 [nativecode=1054 ** Unknown column 'civicrm_custom_field.in_selector' in 'field list']
    [to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT civicrm_custom_field.id as civicrm_custom_field_id, civicrm_custom_field.label as civicrm_custom_field_label, civicrm_custom_field.column_name as civicrm_custom_field_column_name, civicrm_custom_field.data_type as civicrm_custom_field_data_type, civicrm_custom_field.html_type as civicrm_custom_field_html_type, civicrm_custom_field.default_value as civicrm_custom_field_default_value, civicrm_custom_field.attributes as civicrm_custom_field_attributes, civicrm_custom_field.is_required as civicrm_custom_field_is_required, civicrm_custom_field.is_view as civicrm_custom_field_is_view, civicrm_custom_field.help_pre as civicrm_custom_field_help_pre, civicrm_custom_field.help_post as civicrm_custom_field_help_post, civicrm_custom_field.options_per_line as civicrm_custom_field_options_per_line, civicrm_custom_field.start_date_years as civicrm_custom_field_start_date_years, civicrm_custom_field.end_date_years as civicrm_custom_field_end_date_years, civicrm_custom_field.date_format as civicrm_custom_field_date_format, civicrm_custom_field.time_format as civicrm_custom_field_time_format, civicrm_custom_field.option_group_id as civicrm_custom_field_option_group_id, civicrm_custom_field.in_selector as civicrm_custom_field_in_selector, civicrm_custom_group.id as civicrm_custom_group_id, civicrm_custom_group.name as civicrm_custom_group_name, civicrm_custom_group.table_name as civicrm_custom_group_table_name, civicrm_custom_group.title as civicrm_custom_group_title, civicrm_custom_group.help_pre as civicrm_custom_group_help_pre, civicrm_custom_group.help_post as civicrm_custom_group_help_post, civicrm_custom_group.collapse_display as civicrm_custom_group_collapse_display, civicrm_custom_group.style as civicrm_custom_group_style, civicrm_custom_group.is_multiple as civicrm_custom_group_is_multiple, civicrm_custom_group.extends as civicrm_custom_group_extends, civicrm_custom_group.extends_entity_column_id as civicrm_custom_group_extends_entity_column_id, civicrm_custom_group.extends_entity_column_value as civicrm_custom_group_extends_entity_column_value, civicrm_custom_group.max_multiple as civicrm_custom_group_max_multiple 
FROM     civicrm_custom_group
LEFT JOIN civicrm_custom_field ON (civicrm_custom_field.custom_group_id = civicrm_custom_group.id)

WHERE civicrm_custom_group.is_active = 1
  AND civicrm_custom_field.is_active = 1
  AND civicrm_custom_group.extends IN ('Individual', 'Contact')
AND civicrm_custom_group.extends_entity_column_value IS NULL AND  ( 1 )  
ORDER BY civicrm_custom_group.weight,
         civicrm_custom_group.title,
         civicrm_custom_field.weight,
         civicrm_custom_field.label
 [nativecode=1054 ** Unknown column 'civicrm_custom_field.in_selector' in 'field list']"]
)

Aug 14 10:05:12  [info] $backTrace = #0 /home/cremorne/www/www/prodwp/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(227): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
#2 /home/cremorne/www/www/prodwp/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
#3 /home/cremorne/www/www/prodwp/wp-content/plugins/civicrm/civicrm/packages/DB.php(976): PEAR_Error->PEAR_Error("DB Error: no such field", -19, 16, (Array:2), "SELECT civicrm_custom_field.id as civicrm_custom_field_id, civicrm_custom_fie...")
#4 /home/cremorne/www/www/prodwp/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-19, 16, (Array:2), "SELECT civicrm_custom_field.id as civicrm_custom_field_id, civicrm_custom_fie...")
#5 /home/cremorne/www/www/prodwp/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -19, NULL, NULL, "SELECT civicrm_custom_field.id as civicrm_custom_field_id, civicrm_custom_fie...", "DB_Error", TRUE)
#6 /home/cremorne/www/www/prodwp/wp-content/plugins/civicrm/civicrm/packages/DB/mysql.php(895): DB_common->raiseError(-19, NULL, NULL, NULL, "1054 ** Unknown column 'civicrm_custom_field.in_selector' in 'field list'")
#7 /home/cremorne/www/www/prodwp/wp-content/plugins/civicrm/civicrm/packages/DB/mysql.php(328): DB_mysql->mysqlRaiseError()
#8 /home/cremorne/www/www/prodwp/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("SELECT civicrm_custom_field.id as civicrm_custom_field_id, civicrm_custom_fie...")
#9 /home/cremorne/www/www/prodwp/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2438): DB_common->query("SELECT civicrm_custom_field.id as civicrm_custom_field_id, civicrm_custom_fie...")
#10 /home/cremorne/www/www/prodwp/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1627): DB_DataObject->_query("SELECT civicrm_custom_field.id as civicrm_custom_field_id, civicrm_custom_fie...")
#11 /home/cremorne/www/www/prodwp/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(344): DB_DataObject->query("SELECT civicrm_custom_field.id as civicrm_custom_field_id, civicrm_custom_fie...")
#12 /home/cremorne/www/www/prodwp/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1265): CRM_Core_DAO->query("SELECT civicrm_custom_field.id as civicrm_custom_field_id, civicrm_custom_fie...", TRUE)
#13 /home/cremorne/www/www/prodwp/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/CustomGroup.php(526): CRM_Core_DAO::executeQuery("SELECT civicrm_custom_field.id as civicrm_custom_field_id, civicrm_custom_fie...", (Array:0))
#14 /home/cremorne/www/www/prodwp/wp-content/plugins/civicrm/civicrm/CRM/Dedupe/Finder.php(285): CRM_Core_BAO_CustomGroup::getTree("Individual", NULL, NULL, -1)
#15 /home/cremorne/www/www/prodwp/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/UFMatch.php(208): CRM_Dedupe_Finder::formatParams((Array:2), "Individual")
#16 /home/cremorne/www/www/prodwp/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/UFMatch.php(118): CRM_Core_BAO_UFMatch::synchronizeUFMatch(Object(WP_User), 2, "garry.hyman@gmail.com", "WordPress", NULL, "Individual", FALSE)
#17 /home/cremorne/www/www/prodwp/wp-content/plugins/civicrm/includes/civicrm.users.php(177): CRM_Core_BAO_UFMatch::synchronize(Object(WP_User), TRUE, "WordPress", "Individual")
#18 /home/cremorne/www/www/prodwp/wp-content/plugins/civicrm/civicrm.php(1210): CiviCRM_For_WordPress_Users->sync_user(Object(WP_User))
#19 [internal function](): CiviCRM_For_WordPress->invoke("")
#20 /home/cremorne/www/www/prodwp/wp-includes/plugin.php(525): call_user_func_array((Array:2), (Array:1))
#21 /home/cremorne/www/www/prodwp/wp-admin/admin.php(236): do_action("toplevel_page_CiviCRM")
#22 {main}

Help Please?

  • Excellent commentary ! I am thankful for the details . Does anyone know if my business might get access to a template CA LLC-12R form to work with ? – user3857 Oct 12 '16 at 3:07
2

Have managed to upgrade to 4.6.9 now. For anyone else who might be doing this perhaps these steps might help:

  1. Ran the following.

ALTER TABLE civicrm_custom_field ADD COLUMN in_selector tinyint(4) DEFAULT '0' COMMENT 'Should the multi-record custom field values be displayed in tab table listing'; UPDATE civicrm_custom_field cf LEFT JOIN civicrm_custom_group cg ON cf.custom_group_id = cg.id SET cf.in_selector = 1 WHERE cg.is_multiple = 1 AND cf.html_type != 'TextArea'; ALTER TABLE civicrm_custom_group CHANGE COLUMN style style varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Visual relationship between this form and its parent.';

  1. *** Above good and restarted upgrade, it did things and then stopped with following error: Error: Upgrade DB to 4.5.alpha1: SQL] Error Field Error Value Type DB_Error Code -1 Message DB Error: unknown error Mode 16 UserInfo ALTER TABLE civicrm_custom_field ADD COLUMN in_selector tinyint(4) DEFAULT '0' COMMENT 'Should the multi-record custom field values be displayed in tab table listing' [nativecode=1060 ** Duplicate column name 'in_selector'] DebugInfo ALTER TABLE civicrm_custom_field ADD COLUMN in_selector tinyint(4) DEFAULT '0' COMMENT 'Should the multi-record custom field values be displayed in tab table listing' [nativecode=1060 ** Duplicate column name 'in_selector']

Commented out code look for CRM-13992 in file /wp-content/plugins/civicrm/civicrm/CRM/Upgrade/Incremental/sql/4.5.alpha1.mysql.tpl

  1. *** Restarted upgrade and got following error: Error: Upgrade DB to 4.5.alpha1: SQL] Error Field Error Value Type DB_Error Code -1 Message DB Error: unknown error Mode 16 UserInfo ALTER TABLE civicrm_contact ADD COLUMN formal_title varchar(64) COMMENT 'Formal (academic or similar) title in front of name. (Prof., Dr. etc.)' AFTER suffix_id [nativecode=1060 ** Duplicate column name 'formal_title'] DebugInfo ALTER TABLE civicrm_contact ADD COLUMN formal_title varchar(64) COMMENT 'Formal (academic or similar) title in front of name. (Prof., Dr. etc.)' AFTER suffix_id [nativecode=1060 ** Duplicate column name 'formal_title']

  2. * Commented out code and restarted upgrade. Failed a couple of times with duplicates or column not available (previously dropped) so just took this code out of the SQL and restarted upgrade. * It continued upgrading until the following error was encountered

Error: Upgrade DB to 4.6.alpha7] Error Field Error Value Type DB_Error Code -1 Message DB Error: unknown error Mode 16 UserInfo ALTER TABLE civicrm_mailing_abtest ADD COLUMN created_id int unsigned COMMENT 'FK to Contact ID', ADD COLUMN created_date datetime COMMENT 'When was this item created', ADD COLUMN testing_criteria varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, ADD COLUMN winner_criteria varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, ADD CONSTRAINT FK_civicrm_mailing_abtest_created_id FOREIGN KEY (created_id) REFERENCES civicrm_contact(id) ON DELETE SET NULL [nativecode=1060 ** Duplicate column name 'created_id'] DebugInfo ALTER TABLE civicrm_mailing_abtest ADD COLUMN created_id int unsigned COMMENT 'FK to Contact ID', ADD COLUMN created_date datetime COMMENT 'When was this item created', ADD COLUMN testing_criteria varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, ADD COLUMN winner_criteria varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, ADD CONSTRAINT FK_civicrm_mailing_abtest_created_id FOREIGN KEY (created_id) REFERENCES civicrm_contact(id) ON DELETE SET NULL [nativecode=1060 ** Duplicate column name 'created_id']

*** File location for above error shown below: //wp-content/plugins/civicrm/civicrm/CRM/Upgrade/Incremental/sql/4.6.alpha7.mysql.tpl

  1. Comment out all the code for above and restarted upgrade again. [Error: Upgrade DB to 4.6.alpha7] Error Field Error Value Type DB_Error Code -19 Message DB Error: no such field Mode 16 UserInfo UPDATE civicrm_mailing_abtest SET testing_criteria = 'subject' WHERE testing_criteria_id = 1 [nativecode=1054 ** Unknown column 'testing_criteria_id' in 'where clause'] DebugInfo UPDATE civicrm_mailing_abtest SET testing_criteria = 'subject' WHERE testing_criteria_id = 1 [nativecode=1054 ** Unknown column 'testing_criteria_id' in 'where clause']

Found code in upgrade directories and after careful checking commented out relevant pieces as already in place. Restarted and

* Worked and displayed successful upgrade to 4.6.9 screen. However, clicked on CiviCRM icon in Wordpress and it displayed an empty screen. Do the following: 1. Delete files with cached settings. In Wordpress as follows: /wp-content/plugins/files/civicrm/templates_c/ /wp-content/plugins/files/civicrm/ConfigAndLog/Config.IDS.ini

*** 2. Enter the following URL in your browser to review and update directory paths and base URLs. See CiviCRM Menu: Administer >> System Settings >> Cleanup Caches and Update Paths (Reference: https://wiki.civicrm.org/confluence/display/CRMDOC/Moving+an+Existing+Installation+to+a+New+Server+or+Location) For Wordpress sites: http:///wp-admin/admin.php?page=CiviCRM&q=civicrm/admin/setting/updateConfigBackend&reset=1

1

I hope you have backups?

It's often better to do such a big upgrade in parts. Go from 4.4.5 to 4.4.21. Then go to 4.6.20 (4.5 can be skipped, have done upgrades from 4.4 to 4.6 quite often). Then go to 4.7.10.

  • I would also recommend that you test your backups on a development server before upgrading the live site. – William Mortada Aug 14 '16 at 9:46
  • Thanks for tips. Yes restored from my backup twice now successfully. Did upgrade in dev server with success although I may have done an incremental upgrade a year or two back to the then current version. Might see if I can find the incremental versions and try and progress one by one. This is the first time in almost 5 years I have had an issue like this one. – Garry Hyman Aug 14 '16 at 12:41

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.