Upgrade from 1.2.15

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
TimS
Posts: 6
Joined: 21 Feb 2020, 10:49

Upgrade from 1.2.15

Post by TimS »

Hey guys,

i am following the guide on he upgrade process for Mantis. However i am getting some schema missmatch errors.


The installed version is Mantis 1.2.15 with Schema 89.
When download a new (old) version of 1.2.15 and install it with a new (latest) MariaDB setup, the schema version is at 183.
So it is supposed to fail, when trying to import the database-dump and the perform the upgrade, because of the mismatching schemas.

Which MantisBT Version do i need to be able to import my 89-schema database?

After importing the old database and navigating to /admin/install.php and pressing upgrade/install button but only printing the SQL-statements i get:

Code: Select all

ALTER TABLE mantis_bug_table DROP COLUMN date_submitted;
ALTER TABLE mantis_bug_table CHANGE COLUMN date_submitted_int date_submitted INTEGER UNSIGNED NOT NULL DEFAULT 1;
ALTER TABLE mantis_bug_table DROP COLUMN due_date;
ALTER TABLE mantis_bug_table CHANGE COLUMN due_date_int due_date INTEGER UNSIGNED NOT NULL DEFAULT 1;
ALTER TABLE mantis_bug_table DROP COLUMN last_updated;
ALTER TABLE mantis_bug_table CHANGE COLUMN last_updated_int last_updated INTEGER UNSIGNED NOT NULL DEFAULT 1;
ALTER TABLE mantis_bugnote_table DROP INDEX idx_last_mod;
...
and the 2nd line is the first to fail, because the column does not exists. But it keeps on going like this.

How do i have to start the upgrade process, e.g. which version do i have to use to be able to ugrade from this very old schema properly?
atrol
Site Admin
Posts: 8378
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Upgrade from 1.2.15

Post by atrol »

TimS wrote: 25 Feb 2020, 16:11 but only printing the SQL-statements
I assume the upgrade to a clean 1.2.x will run well if you don't check the check box to print only the SQL-statements.

Schema version 89 was never an official version, but is based on a source code download between 1.2.0 alpha 3 and final version 1.2.0 https://github.com/mantisbt/mantisbt/bl ... a.php#L587

So it seems that someone installed 1.2.15 later after that, but didn't run the schema upgrade.
Please use Search before posting and read the Manual
TimS
Posts: 6
Joined: 21 Feb 2020, 10:49

Re: Upgrade from 1.2.15

Post by TimS »

I tried to upgrade to the direct successor 1.2.16 and the last version 1.2.20 with unpacking to a specific folder and then running:

Code: Select all

http://localhost:1234/mantis20/admin/install.php
http://localhost:1234/mantis16/admin/install.php
both failing with this error message:

APPLICATION ERROR #401
Database query failed. Error received from database was #1054: Unknown column 'date_submitted_int' in 'where clause' for the query:
SELECT id, date_submitted,due_date,last_updated FROM mantis_bug_table WHERE date_submitted_int = 1 OR due_date_int = 1 OR last_updated_int = 1.
Please use the "Back" button ...
This query mixed up some things. I tried looking for the location where it is acutally been called/created, maybe it is build generic(?).
At some point the column date_submitted is changed to date_submitted_int, so that the schema.php file is "entered" at the wrong place in time?
The first execution step from the schema should be

Code: Select all

$g_upgrade[90] = array( 'UpdateFunction', 'date_migrate', array( db_get_table( 'bug' ), 'id', array( 'date_submitted', 'due_date', 'last_updated' ), array( 'date_submitted_int', 'due_date_int', 'last_updated_int' ) ) );
Maybe i manage to upgrade the schema alone with https://www.mantisbt.org/wiki/doku.php/ ... are_update
TimS
Posts: 6
Joined: 21 Feb 2020, 10:49

Re: Upgrade from 1.2.15

Post by TimS »

In the previous mentioned script i set:

Code: Select all

SET @schema_reference = 'mantis_1216';
the result however, seems not too helpful (:

Code: Select all

-- Create Temporary Helper views
-- Update Column type and Nullable attribute
-- Default value
-- Tables
DROP TABLE mantis_tag_table ;
DROP TABLE mantis_bug_history_table ;
DROP TABLE mantis_bug_monitor_table ;
DROP TABLE mantis_project_user_list_table ;
DROP TABLE mantis_project_category_table ;
DROP TABLE mantis_user_profile_table ;
DROP TABLE mantis_tokens_table ;
DROP TABLE mantis_bug_file_table ;
DROP TABLE mantis_news_table ;
DROP TABLE mantis_user_table ;
DROP TABLE mantis_custom_field_project_table ;
DROP TABLE mantis_category_table ;
DROP TABLE mantis_bug_table_kor ;
DROP TABLE mantis_project_table ;
DROP TABLE mantis_bug_revision_table ;
DROP TABLE mantis_user_print_pref_table ;
DROP TABLE mantis_project_hierarchy_table ;
DROP TABLE mantis_project_version_table ;
DROP TABLE mantis_filters_table ;
DROP TABLE mantis_bug_table ;
DROP TABLE mantis_custom_field_string_table ;
DROP TABLE mantis_user_pref_table ;
DROP TABLE mantis_bug_relationship_table ;
DROP TABLE mantis_email_table ;
DROP TABLE mantis_sponsorship_table ;
DROP TABLE mantis_bug_text_table ;
DROP TABLE mantis_bugnote_text_table ;
DROP TABLE mantis_custom_field_table ;
DROP TABLE mantis_project_file_table ;
DROP TABLE mantis_bug_tag_table ;
DROP TABLE mantis_config_table ;
DROP TABLE mantis_bugnote_table ;
-- Indexes
-- Drop Temporary Helper views
Post Reply