Upgrade Mantisbt from 1.0.5. to 2.26.0

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
ludovitb
Posts: 2
Joined: 28 Nov 2023, 05:59

Upgrade Mantisbt from 1.0.5. to 2.26.0

Post by ludovitb »

[/issue]Hello,

I am trying to upgrade Mantisbt from very old version 1.0.5 to current version 2.26.0.

Server is current version WAMP server on my notebook.
Pre-Installation Check is OK, all conditions GOOD.
I can generate SQL update script with "Print SQL Queries instead of Writing to the Database" enabled ON.

When I run upgrade, update process ends after Step 76, NO ERROR SO FAR.
From Schema step 77 update process doesn´t continue. Manual insert into mantis_plugin_table is OK.

When I run the upgrade repeatedly via http://localhost/mantisbt-2.26.0/admin/index.php , there is an error:
APPLICATION ERROR #401

The request to the database failed. Database error #1054: Unknown column 'priority' in 'field list' when requesting: SELECT basename, priority, protected
FROM mantis_plugin_table
WHERE enabled=?
ORDER BY priority DESC.

To return to the previous page, please use the "Back" button in your browser. You can then fix all the problems described in this error or choose another operation. You can also click on an option from the menu bar to go to a new section.
Previous non-fatal errors occurred. Page contents follow.
SQL Statement failed on preparation: SELECT basename, priority, protected FROM mantis_plugin_table WHERE enabled=? ORDER BY priority DESC'

Table mantis_plugin_table has only 1 row - basename, priority, protected, enabled = MantisCoreFormatting, 3, 0, TRUE


When I run SQL update SCRIPT MANUALLY without (=PHP functions in ), there are 3 errors, when I disable these steps, the script runs to the end:
-- Schema step 85
ALTER TABLE mantis_bug_revision_table ADD INDEX idx_bug_rev_id_time (bug_id, timestamp);
-- index exists
-- Schema step 159
ALTER TABLE mantis_bug_revision_table ADD INDEX idx_bug_rev_id_time (bug_id, timestamp);
-- index exists
-- Schema step 86
ALTER TABLE mantis_bug_revision_table ADD INDEX idx_bug_rev_type (type);
-- index exists

See update script in the attachment.

Please help me with update process, my questions:
1. How to identify why update script unexpectedly ends at Steps 76, no error?
2. How to continue in update process (run repeatedly) - I need to run PHP functions to fill database...
3. How to avoid Steps 85, 159, 86 - Steps numbers are changing...

THANK YOU VERY MUCH for your kind help.

Ludo.
cas
Posts: 1622
Joined: 11 Mar 2006, 16:08
Contact:

Re: Upgrade Mantisbt from 1.0.5. to 2.26.0

Post by cas »

Do it in steps so first upgrade to 1.1 then to 1.2 and the to 2.x
ludovitb
Posts: 2
Joined: 28 Nov 2023, 05:59

Re: Upgrade Mantisbt from 1.0.5. to 2.26.0

Post by ludovitb »

Hallo cas, thanks for advice.

That exactly was my very first idea.

But unfortunately there is too many errors in php code,
I suppose that php source code is very old for php 8.0.26 which is in wamp server.
I am not a php programmer :-(

In my opinion, the way would be if I could manually run the SQL script and PHP functions one by one

Ludo.
Last edited by ludovitb on 30 Nov 2023, 21:20, edited 1 time in total.
cas
Posts: 1622
Joined: 11 Mar 2006, 16:08
Contact:

Re: Upgrade Mantisbt from 1.0.5. to 2.26.0

Post by cas »

Hi Ludovitb,
you should first upgrade on the existing box where the old version is running as far as possible within that environment (PHP/SQL). Support for PHP version 8 is only as of 2.25 (if I am corect). So you need to work around that. All DB steps can be found in admin/schema.php
ludovitb
Posts: 2
Joined: 28 Nov 2023, 05:59

Re: Upgrade Mantisbt from 1.0.5. to 2.26.0

Post by ludovitb »

Only for info:

I managed to migrate Mantis 1.0.5 to 2.26.0 as follows:

Environment: Windows WAMP server, MantidBT 2.26.0 on my notebook with dump mantis DB 1.0.5 from Linux server

I generated an update script and divided it into steps:
1. database alter part (run manually from HeidiSQL)
At the end of each alter section I started update versions (step number)
-- Set database version
UPDATE mantis_config_table SET value = XX WHERE config_id = 'database_version' AND project_id = 0 AND user_id = 0;


2. php functions launched from the web environment with a modified schema.php file (schema.php always terminated after the corresponding php function step).
Subsequently, via http://localhost/mantisbt-2.26.0/admin/install.php, I always started the next step with the php function in one step.

In total, the upgrade contained 43 steps: 21 alter sections + 22 php functions.

After testing I transferred final upgraded database to a new Linux server with fresh version 2.26.0

Result: the MantisBT runs on new Linux server with current version 2.26.0
Post Reply