Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006594TestLinkMigration/Upgrade Testlinkpublic2014-09-23 11:522017-06-09 15:40
Reporterjan.pilz 
Assigned Tofman 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformLinuxOSUbuntuOS VersionUbuntu 12.04 LTS
Product Version1.9.11 (2014 Q2 - bug fixing) 
Fixed in Version 
Summary0006594: Migration scripts don't cover testcase steps and expected results, also testcase ID's are empty in GUI
DescriptionWe've recently upgraded our old testlink 1.7.4 to newest 1.9.11 and figured some lack in the migration scripts:

- 1st: tcversions.tc_external_id is empty for all testcases, but it will be displayed in GUI (so nothing is displayed in GUI), fixed by this sql:

update tcversions tv
set tv.tc_external_id = (select parent_id from nodes_hierarchy where nodes_hierarchy.id = tv.id);

- 2nd: The project prefix is empty, but it's mandatory in newer version, resulting in strange pages where all testcases are displayed like "-1234" or "-9999", fixed by going to project page and adding a prefix

- 3rd: all test steps and expected results of former testcases were missing, this is because the structure changed from column to extra table, anyhow i made this little procedure to migrate them to new structure:

DROP PROCEDURE IF EXISTS insert_steps;

DELIMITER $$
CREATE PROCEDURE insert_steps()
BEGIN
    declare inserted int default 0;
    DECLARE done INT DEFAULT 0;
    DECLARE new_tcsteps_id INT;
    DECLARE tcase_id INT;
    DECLARE fetch_steps TEXT;
    DECLARE fetch_expected_results TEXT;
    DECLARE csr CURSOR FOR
            SELECT id,steps,expected_results
            from tcversions
            where tcversions.steps != '' or tcversions.expected_results != '';
    DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;

    OPEN csr;
        my_cur_loop:
        LOOP FETCH csr INTO tcase_id, fetch_steps, fetch_expected_results;
        IF done = 1 THEN
            LEAVE my_cur_loop;
        END IF;
        SELECT IFNULL(MAX(id)+1,1) INTO new_tcsteps_id FROM nodes_hierarchy;
        INSERT INTO tcsteps(id, actions, expected_results) VALUES(new_tcsteps_id, fetch_steps, fetch_expected_results);
        INSERT INTO nodes_hierarchy(id,parent_id,node_type_id) VALUES(new_tcsteps_id,tcase_id,9);
        set inserted := inserted + 1;
    END LOOP my_cur_loop;
    
    CLOSE csr;

    SELECT concat('inserted ', inserted );
END$$

DELIMITER ;

CALL insert_steps();

DROP PROCEDURE IF EXISTS insert_steps;



It would be nice if you can add these statements to the migration scripts.
TagsNo tags attached.
Database (MySQL,Postgres,etc)MySQL
Browser
PHP Version
TestCaseID
QA Team - Task Workflow StatusTBD
Attached Files

- Relationships

-  Notes
(0021659)
fman (administrator)
2014-09-23 12:45

Thanks for your contribution

>> We've recently upgraded our old testlink 1.7.4
>> to newest 1.9.11 and figured some lack in the migration scripts:
Important thing to know is process used to do this migration
My advice is slow and safe: 1.7.4 to 1.8.... and so on, testing on each migration/update.

1.7.4 is so old that effort to support migration is not possible.

I will put a link on forum and note on next release README to this issue, in this way this will be useful for other users
(0021661)
jan.pilz (reporter)
2014-09-23 12:51

i understand, but of course i ran through every single migration script from 1.7.4 up to 1.9.11, the tcsteps issue is comming with the 1.8 -> 1.9 migration script

the external id issue is coming with migration from 1.7.4 -> 1.8
(0025341)
fman (administrator)
2016-09-08 15:13

1.9.15 Released - 2016-09-08

- Issue History
Date Modified Username Field Change
2014-09-23 11:52 jan.pilz New Issue
2014-09-23 12:45 fman Note Added: 0021659
2014-09-23 12:46 fman QA Team - Task Workflow Status => TBD
2014-09-23 12:46 fman Status new => resolved
2014-09-23 12:46 fman Resolution open => fixed
2014-09-23 12:46 fman Assigned To => fman
2014-09-23 12:51 jan.pilz Note Added: 0021661
2016-09-08 15:13 fman Note Added: 0025341
2016-09-08 15:13 fman Status resolved => closed



Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker