problems with db upgrade from 1.8.x to 1.9

LATEST Official version.
Questions and discussions - NO ISSUES
FOR ISSUES => http://mantis.testlink.org

Moderators: Amaradana, TurboPT, TL Developers

Post Reply
tbennett
Advanced user
Posts: 36
Joined: Wed May 20, 2009 10:50 pm

problems with db upgrade from 1.8.x to 1.9

Post by tbennett »

I attempted to upgrade from 1.8.x to 1.9. Got through the first page of checks, but it stalled at the database upgrade.

There's a big page of text, starting with the following. (I'm using php 5.2.5, mysql 5.051a.)

Connecting to database `testlink`: OK!
Creating Testlink DB user `TLAdmin`: OK! (ok - user_exists ok - grant assignment)
Processing:sql/alter_tables/1.9/mysql/DB.1.3/step1/db_schema_update.sql


It's hard to see the actual errors, but I think the first one is:
'Unknown column 'scope' in 'field list'

and subsequent errors are like the following:
Duplicate entry '15497-1' for key 1

the full details of the first error are shown below:

============================================================================== DB Access Error - debug_print_backtrace() OUTPUT START ============================================================================== #0 database->exec_query( INSERT INTO req_versions (id,scope,status,type,author_id,creation_ts,modifier_id,modification_ts, version,expected_coverage) SELECT id,scope,status,type,author_id,creation_ts,modifier_id,modification_ts, 1 AS version, 1 AS expected_coverage FROM requirements) called at [/var/www/html/testlink/install/migration/migrate_18/migrate_18_to_19.php:83]
#1 migrate_requirements(database Object ([db] => ADODB_mysql Object ([databaseType] => mysql,[dataProvider] => mysql,[hasInsertID] => 1,[hasAffectedRows] => 1,[metaTablesSQL] => SHOW TABLES,[metaColumnsSQL] => SHOW COLUMNS FROM `%s`,[fmtTimeStamp] => 'Y-m-d H:i:s',[hasLimit] => 1,[hasMoveFirst] => 1,[hasGenID] => 1,[isoDates] => 1,[sysDate] => CURDATE(),[sysTimeStamp] => NOW(),[hasTransactions] => ,[forceNewConnect] => 1,[poorAffectedRows] => 1,[clientFlags] => 0,[substr] => substring,[nameQuote] => `,[compat323] => ,[_genIDSQL] => update %s set id=LAST_INSERT_ID(id+1);,[_genSeqSQL] => create table %s (id int not null),[_genSeqCountSQL] => select count(*) from %s,[_genSeq2SQL] => insert into %s values (%s),[_dropSeqSQL] => drop table %s,[database] => testlink,[host] => localhost,[user] => root,[password] => ve7xci,[debug] => ,[maxblobsize] => 262144,[concat_operator] => +,[length] => length,[random] => rand(),[upperCase] => upper,[fmtDate] => 'Y-m-d',[true] => 1,[false] => 0,[replaceQuote] => \',[charSet] => ,[metaDatabasesSQL] => ,[uniqueOrderBy] => ,[emptyDate] => ,[emptyTimeStamp] => ,[lastInsID] => ,[hasTop] => ,[readOnly] => ,[genID] => 0,[raiseErrorFn] => ,[cacheSecs] => 3600,[memCache] => ,[memCacheHost] => ,[memCachePort] => 11211,[memCacheCompress] => ,[sysUTimeStamp] => ,[arrayClass] => ADORecordSet_array,[noNullStrings] => ,[numCacheHits] => 0,[numCacheMisses] => 0,[pageExecuteCountRows] => 1,[uniqueSort] => ,[leftOuter] => ,[rightOuter] => ,[ansiOuter] => ,[autoRollback] => ,[fnExecute] => ,[fnCacheExecute] => ,[blobEncodeType] => ,[rsPrefix] => ADORecordSet_,[autoCommit] => 1,[transOff] => 0,[transCnt] => 0,[fetchMode] => 2,[null2null] => null,[_oldRaiseFn] => ,[_transOK] => ,[_connectionID] => Resource id #55,[_errorMsg] => Unknown column 'scope' in 'field list',[_errorCode] => ,[_queryID] => ,[_isPersistentConnection] => ,[_bindInputArray] => ,[_evalAll] => ,[_affected] => ,[_logsql] => ,[_transmode] => ,[databaseName] => testlink),[queries_array] => Array (),[is_connected] => 1,[nQuery] => 46,[overallDuration] => 0.6668,[] => 0,[] => 0), Array ([assignment_status] => assignment_status,[assignment_types] => assignment_types,[attachments] => attachments,[builds] => builds,[cfield_design_values] => cfield_design_values,[cfield_execution_values] => cfield_execution_values,[cfield_node_types] => cfield_node_types,[cfield_testplan_design_values] => cfield_testplan_design_values,[cfield_testprojects] => cfield_testprojects,[custom_fields] => custom_fields,[db_version] => db_version,[events] => events,[execution_bugs] => execution_bugs,[executions] => executions,[inventory] => inventory,[keywords] => keywords,[milestones] => milestones,[node_types] => node_types,[nodes_hierarchy] => nodes_hierarchy,[object_keywords] => object_keywords,[platforms] => platforms,[req_coverage] => req_coverage,[req_relations] => req_relations,[req_specs] => req_specs,[req_suites] => req_suites,[requirements] => requirements,[req_versions] => req_versions,[rights] => rights,[risk_assignments] => risk_assignments,[role_rights] => role_rights,[roles] => roles,[tcversions] => tcversions,[tcsteps] => tcsteps,[testcase_keywords] => testcase_keywords,[testplan_platforms] => testplan_platforms,[testplan_tcversions] => testplan_tcversions,[testplans] => testplans,[testprojects] => testprojects,[testsuites] => testsuites,[text_templates] => text_templates,[transactions] => transactions,[user_assignments] => user_assignments,[user_group] => user_group,[user_group_assign] => user_group_assign,[user_testplan_roles] => user_testplan_roles,[user_testproject_roles] => user_testproject_roles,[users] => users)) called at [/var/www/html/testlink/install/migration/migrate_18/migrate_18_to_19.php:44]
#2 migrate_18_to_19(database Object ([db] => ADODB_mysql Object ([databaseType] => mysql,[dataProvider] => mysql,[hasInsertID] => 1,[hasAffectedRows] => 1,[metaTablesSQL] => SHOW TABLES,[metaColumnsSQL] => SHOW COLUMNS FROM `%s`,[fmtTimeStamp] => 'Y-m-d H:i:s',[hasLimit] => 1,[hasMoveFirst] => 1,[hasGenID] => 1,[isoDates] => 1,[sysDate] => CURDATE(),[sysTimeStamp] => NOW(),[hasTransactions] => ,[forceNewConnect] => 1,[poorAffectedRows] => 1,[clientFlags] => 0,[substr] => substring,[nameQuote] => `,[compat323] => ,[_genIDSQL] => update %s set id=LAST_INSERT_ID(id+1);,[_genSeqSQL] => create table %s (id int not null),[_genSeqCountSQL] => select count(*) from %s,[_genSeq2SQL] => insert into %s values (%s),[_dropSeqSQL] => drop table %s,[database] => testlink,[host] => localhost,[user] => root,[password] => ve7xci,[debug] => ,[maxblobsize] => 262144,[concat_operator] => +,[length] => length,[random] => rand(),[upperCase] => upper,[fmtDate] => 'Y-m-d',[true] => 1,[false] => 0,[replaceQuote] => \',[charSet] => ,[metaDatabasesSQL] => ,[uniqueOrderBy] => ,[emptyDate] => ,[emptyTimeStamp] => ,[lastInsID] => ,[hasTop] => ,[readOnly] => ,[genID] => 0,[raiseErrorFn] => ,[cacheSecs] => 3600,[memCache] => ,[memCacheHost] => ,[memCachePort] => 11211,[memCacheCompress] => ,[sysUTimeStamp] => ,[arrayClass] => ADORecordSet_array,[noNullStrings] => ,[numCacheHits] => 0,[numCacheMisses] => 0,[pageExecuteCountRows] => 1,[uniqueSort] => ,[leftOuter] => ,[rightOuter] => ,[ansiOuter] => ,[autoRollback] => ,[fnExecute] => ,[fnCacheExecute] => ,[blobEncodeType] => ,[rsPrefix] => ADORecordSet_,[autoCommit] => 1,[transOff] => 0,[transCnt] => 0,[fetchMode] => 2,[null2null] => null,[_oldRaiseFn] => ,[_transOK] => ,[_connectionID] => Resource id #55,[_errorMsg] => Unknown column 'scope' in 'field list',[_errorCode] => ,[_queryID] => ,[_isPersistentConnection] => ,[_bindInputArray] => ,[_evalAll] => ,[_affected] => ,[_logsql] => ,[_transmode] => ,[databaseName] => testlink),[queries_array] => Array (),[is_connected] => 1,[nQuery] => 46,[overallDuration] => 0.6668,[] => 0,[] => 0), Array ([assignment_status] => assignment_status,[assignment_types] => assignment_types,[attachments] => attachments,[builds] => builds,[cfield_design_values] => cfield_design_values,[cfield_execution_values] => cfield_execution_values,[cfield_node_types] => cfield_node_types,[cfield_testplan_design_values] => cfield_testplan_design_values,[cfield_testprojects] => cfield_testprojects,[custom_fields] => custom_fields,[db_version] => db_version,[events] => events,[execution_bugs] => execution_bugs,[executions] => executions,[inventory] => inventory,[keywords] => keywords,[milestones] => milestones,[node_types] => node_types,[nodes_hierarchy] => nodes_hierarchy,[object_keywords] => object_keywords,[platforms] => platforms,[req_coverage] => req_coverage,[req_relations] => req_relations,[req_specs] => req_specs,[req_suites] => req_suites,[requirements] => requirements,[req_versions] => req_versions,[rights] => rights,[risk_assignments] => risk_assignments,[role_rights] => role_rights,[roles] => roles,[tcversions] => tcversions,[tcsteps] => tcsteps,[testcase_keywords] => testcase_keywords,[testplan_platforms] => testplan_platforms,[testplan_tcversions] => testplan_tcversions,[testplans] => testplans,[testprojects] => testprojects,[testsuites] => testsuites,[text_templates] => text_templates,[transactions] => transactions,[user_assignments] => user_assignments,[user_group] => user_group,[user_group_assign] => user_group_assign,[user_testplan_roles] => user_testplan_roles,[user_testproject_roles] => user_testproject_roles,[users] => users)) called at [/var/www/html/testlink/install/installNewDB.php:437]
==============================================================================
tbennett
Advanced user
Posts: 36
Joined: Wed May 20, 2009 10:50 pm

Re: problems with db upgrade from 1.8.x to 1.9

Post by tbennett »

Found the solution. I was running into problems because my existing database had newer tables, which I didn't realize mysql restore didn't clear up.
Post Reply