Import Dump from Mantis 1.2.15 to Mantis 2.23

Get help from other users here.

Moderators: Developer, Contributor

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

Import Dump from Mantis 1.2.15 to Mantis 2.23

Post by TimS »

Hello folks,
first thanks for maintaining and taking care of this awesome simple tool!!
We have a Mantis Installation running stable for a long time.

Now we face the issue of moving everything to a new server with a fresh setup. So i basically followed these steps https://www.mantisbt.org/wiki/doku.php/ ... mp_restore to create the dump files.

On the new machine i did
  • Install latest Mantis
  • Setup new Database with new root user
  • Loggin into the database
  • mysql -uroot -ppw bugtracker < mantisdb_files.sql
  • mysql -uroot -ppw bugtracker < mantisdb.sql
  • using the config_inc.php from the new installation
I am able to login with my old account and get redirected to /admin/install.php
When i type in the new admin credentials and press the install/upgrade button i get 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 in your web browser to return to the previous page. There you can correct whatever problems were identified in this error or select another action. You can also click an option from the menu bar to go directly to a new section.
It seems like the php process is looking for some wrong columns since in the table descriptions are different column names. However in the schema file there are some renamings happening. Might the upgrade process failed?

Old table format (from sql dump file)

Code: Select all

CREATE TABLE `mantis_bug_table` (
  `id` int(7) unsigned NOT NULL AUTO_INCREMENT,
  `project_id` int(7) unsigned NOT NULL DEFAULT '0',
  `reporter_id` int(7) unsigned NOT NULL DEFAULT '0',
  `handler_id` int(7) unsigned NOT NULL DEFAULT '0',
  `duplicate_id` int(7) unsigned NOT NULL DEFAULT '0',
  `priority` int(2) NOT NULL DEFAULT '30',
  `severity` int(2) NOT NULL DEFAULT '50',
  `reproducibility` int(2) NOT NULL DEFAULT '10',
  `status` int(2) NOT NULL DEFAULT '10',
  `resolution` int(2) NOT NULL DEFAULT '10',
  `projection` int(2) NOT NULL DEFAULT '10',
  `eta` int(2) NOT NULL DEFAULT '10',
  `bug_text_id` int(7) unsigned NOT NULL DEFAULT '0',
  `os` varchar(32) NOT NULL DEFAULT '',
  `os_build` varchar(32) NOT NULL DEFAULT '',
  `platform` varchar(32) NOT NULL DEFAULT '',
  `version` varchar(64) NOT NULL DEFAULT '',
  `fixed_in_version` varchar(64) NOT NULL DEFAULT '',
  `build` varchar(32) NOT NULL DEFAULT '',
  `profile_id` int(7) unsigned NOT NULL DEFAULT '0',
  `view_state` int(2) NOT NULL DEFAULT '10',
  `summary` varchar(128) NOT NULL DEFAULT '',
  `sponsorship_total` int(7) NOT NULL DEFAULT '0',
  `sticky` tinyint(1) NOT NULL DEFAULT '0',
  `target_version` varchar(64) NOT NULL DEFAULT '',
  `category_id` int(10) unsigned NOT NULL DEFAULT '1',
  `due_date` int(10) unsigned NOT NULL DEFAULT '1',
  `last_updated` int(10) unsigned NOT NULL DEFAULT '1',
  `date_submitted` int(10) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `sponsorship_total` (`sponsorship_total`),
  KEY `fixed_in_version` (`fixed_in_version`),
  KEY `status` (`status`),
  KEY `project_id` (`project_id`)
)


However the old users and all projects are correctly importet but not the issues. The summary page does show some statistics. When i click there on a specific id (longest open issue) i get the following message:
APPLICATION ERROR #401

Database query failed. Error received from database was #1054: Unknown column 'bugnote_id' in 'field list' for the query: SELECT id, title, diskfile, filename, filesize, file_type, date_added, user_id, bugnote_id
FROM mantis_bug_file_table
WHERE bug_id=?
ORDER BY date_added.
Please use the "Back" button in your web browser to return to the previous page. There you can correct whatever problems were identified in this error or select another action. You can also click an option from the menu bar to go directly to a new section.
Which i can confirm, that is column does not exists in the old table

old setup:
Mantis: 1.2.25 Schema: 89
target setup:
Mantis: 2.2.23 Schema: 210

Thanks for any advice on how to handle the (schema)-migration and resolve these issues
Last edited by TimS on 21 Feb 2020, 13:49, edited 1 time in total.
TimS
Posts: 6
Joined: 21 Feb 2020, 10:49

Re: Import Dump from Mantis 1.2.15 to Mantis 2.2.23

Post by TimS »

Running the upgrade php script also shows this error:

Code: Select all

# php upgrade_unattended.php
  Post 1.0 schema changes
  Connecting to database... OK
  Schema step 90: UpdateFunction ( date_migrate ) 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.
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Import Dump from Mantis 1.2.15 to Mantis 2.23

Post by cas »

You should not restore a backup of an older version into the latest version.
Setup the old version on your new server, then import the backup , next do the update :mrgreen:
TimS
Posts: 6
Joined: 21 Feb 2020, 10:49

Re: Import Dump from Mantis 1.2.15 to Mantis 2.23

Post by TimS »

Ah ok, i was unaware that is not possible directly. I ll try as you suggested. Thanks!
Amiz
Posts: 2
Joined: 05 Jun 2020, 09:28

Re: Import Dump from Mantis 1.2.15 to Mantis 2.23

Post by Amiz »

Hello,

We also meet this scheme version problem.

Regarding cas comment:
You should not restore a backup of an older version into the latest version.
Setup the old version on your new server, then import the backup , next do the update

Yes, we moved the old database and old Mantis version to the new server,
but we do not know how to do the update,
Could you give us some advice?

Thanks very much
Amiz
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Import Dump from Mantis 1.2.15 to Mantis 2.23

Post by atrol »

Please use Search before posting and read the Manual
Amiz
Posts: 2
Joined: 05 Jun 2020, 09:28

Re: Import Dump from Mantis 1.2.15 to Mantis 2.23

Post by Amiz »

Hello, atrol

Thanks for your feedback.

The point problem is that
How can we generate the bugnote_id for data of the old mantis version before upgrading to version 2.23.

what it the problem:
----------
the old version: id will `Not` be generated for attachment-only note.
the version 2.23: id will be generated for attachment-only note.
As we know,
In DB, column : bugnote_id is fetching the value of ` id of attachment-only note`.
so for the old databse, bugnote_id shows 0 only.
----------

If we directly use the old DB data, there will be a error message:
BAD
ALTER TABLE mantis_bug_file_table ADD bugnote_id INTEGER UNSIGNED DEFAULT 0
Duplicate column name 'bugnote_id'

Could you give us some advice on it.
Thanks very much.
Best regards
Amiz
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Import Dump from Mantis 1.2.15 to Mantis 2.23

Post by atrol »

Amiz wrote: 22 Jun 2020, 08:07 If we directly use the old DB data, there will be a error message:
BAD
ALTER TABLE mantis_bug_file_table ADD bugnote_id INTEGER UNSIGNED DEFAULT 0
Duplicate column name 'bugnote_id'
It seems you are not using the old database to run the upgrade script, as a 1.2.x database does not have column bugnote_id in table mantis_bug_file_table
https://mantisbt.org/docs/erd/mantisbt_ ... erd_r2.pdf
Please use Search before posting and read the Manual
Post Reply