upgrading 1.2.1 -> 1.2.17

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
mohrt
Posts: 3
Joined: 01 Jul 2014, 15:09

upgrading 1.2.1 -> 1.2.17

Post by mohrt »

Hi, I'm trying to upgrade mantis 1.2.1 -> 1.2.17, I back up the files and db, put in the new files and copy over configs, then I run the admin/install.php and it fails on:

BAD
ALTER TABLE mantis_bug_revision_table ADD INDEX idx_bug_rev_id_time (bug_id, timestamp)
Duplicate key name 'idx_bug_rev_id_time'

Screenshot:

http://cl.ly/image/2A2k3k1k0z2y

It appears to be trying to create an already created index. Am I doing the steps correctly?

TIA
atrol
Site Admin
Posts: 8376
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: upgrading 1.2.1 -> 1.2.17

Post by atrol »

mohrt wrote:Am I doing the steps correctly?
Seems no.
You have to follow exactly the steps described at
http://www.mantisbt.org/docs/master-1.2 ... LL.UPGRADE

There is no database schema change between 1.2.1 and 1.2.17.
Thus I don't expect any ALTER TABLE.

I recommend to start again from 1.2.1.
Goto Page "Manage" where you should see something like
Site Information
MantisBT Version 1.2.1
Schema Version 183
If you don't see the "183" there is something wrong with your 1.2.1.
Please use Search before posting and read the Manual
mohrt
Posts: 3
Joined: 01 Jul 2014, 15:09

Re: upgrading 1.2.1 -> 1.2.17

Post by mohrt »

Hmm, this is on the manage page:
MantisBT Version 1.2.1
Schema Version 158
Site Path /www/Mantis/
Core Path /www/Mantis/core/
Plugin Path /www/Mantis/plugins/
mohrt
Posts: 3
Joined: 01 Jul 2014, 15:09

Re: upgrading 1.2.1 -> 1.2.17

Post by mohrt »

I wasn't involved in this installation, do you have any idea why/how the schema is incorrect, and more importantly, how to get this into an upgradeable state? I don't believe anything in the install was modified outside of the config_inc.php file. I tried installing the 1.2.1 files from source and run an upgrade of the db, and I still get the same error.
Xyem
Posts: 2
Joined: 02 Aug 2014, 20:00

Re: upgrading 1.2.1 -> 1.2.17

Post by Xyem »

This happens on fresh installations as well. It's running the same ALTER TABLE statement twice (see bold)
<trim />
ALTER TABLE mantis_plugin_table ADD protected TINYINT NOT NULL DEFAULT '0';

ALTER TABLE mantis_plugin_table ADD priority INTEGER UNSIGNED NOT NULL DEFAULT 3;

ALTER TABLE mantis_project_version_table ADD obsolete TINYINT NOT NULL DEFAULT '0';

ALTER TABLE mantis_bug_table ADD due_date DATETIME NOT NULL DEFAULT '1970-01-01 00:00:01';

ALTER TABLE mantis_custom_field_table ADD filter_by TINYINT NOT NULL DEFAULT '1';

CREATE TABLE mantis_bug_revision_table (
id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
bug_id INTEGER UNSIGNED NOT NULL,
bugnote_id INTEGER UNSIGNED NOT NULL DEFAULT 0,
user_id INTEGER UNSIGNED NOT NULL,
timestamp DATETIME NOT NULL DEFAULT '1970-01-01 00:00:01',
type INTEGER UNSIGNED NOT NULL,
value LONGTEXT NOT NULL,
PRIMARY KEY (id)
)ENGINE=MyISAM DEFAULT CHARSET=utf8;

ALTER TABLE mantis_bug_revision_table ADD INDEX idx_bug_rev_id_time (bug_id, timestamp);

ALTER TABLE mantis_bug_revision_table ADD INDEX idx_bug_rev_type (type);

ALTER TABLE mantis_bug_table ADD date_submitted_int INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_bug_table ADD due_date_int INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_bug_table ADD last_updated_int INTEGER UNSIGNED NOT NULL DEFAULT 1;

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 ADD last_modified_int INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_bugnote_table ADD date_submitted_int INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_bugnote_table DROP COLUMN last_modified;

ALTER TABLE mantis_bugnote_table CHANGE COLUMN last_modified_int last_modified INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_bugnote_table ADD INDEX idx_last_mod (last_modified);

ALTER TABLE mantis_bugnote_table DROP COLUMN date_submitted;

ALTER TABLE mantis_bugnote_table CHANGE COLUMN date_submitted_int date_submitted INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_bug_file_table ADD date_added_int INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_bug_file_table DROP COLUMN date_added;

ALTER TABLE mantis_bug_file_table CHANGE COLUMN date_added_int date_added INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_project_file_table ADD date_added_int INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_project_file_table DROP COLUMN date_added;

ALTER TABLE mantis_project_file_table CHANGE COLUMN date_added_int date_added INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_bug_history_table ADD date_modified_int INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_bug_history_table DROP COLUMN date_modified;

ALTER TABLE mantis_bug_history_table CHANGE COLUMN date_modified_int date_modified INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_user_table ADD last_visit_int INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_user_table ADD date_created_int INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_user_table DROP COLUMN date_created;

ALTER TABLE mantis_user_table CHANGE COLUMN date_created_int date_created INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_user_table DROP COLUMN last_visit;

ALTER TABLE mantis_user_table CHANGE COLUMN last_visit_int last_visit INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_email_table ADD submitted_int INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_email_table DROP COLUMN submitted;

ALTER TABLE mantis_email_table CHANGE COLUMN submitted_int submitted INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_tag_table ADD date_created_int INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_tag_table ADD date_updated_int INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_tag_table DROP COLUMN date_created;

ALTER TABLE mantis_tag_table CHANGE COLUMN date_created_int date_created INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_tag_table DROP COLUMN date_updated;

ALTER TABLE mantis_tag_table CHANGE COLUMN date_updated_int date_updated INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_bug_tag_table ADD date_attached_int INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_bug_tag_table DROP COLUMN date_attached;

ALTER TABLE mantis_bug_tag_table CHANGE COLUMN date_attached_int date_attached INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_tokens_table ADD timestamp_int INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_tokens_table ADD expiry_int INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_tokens_table DROP COLUMN timestamp;

ALTER TABLE mantis_tokens_table CHANGE COLUMN timestamp_int timestamp INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_tokens_table DROP COLUMN expiry;

ALTER TABLE mantis_tokens_table CHANGE COLUMN expiry_int expiry INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_news_table ADD last_modified_int INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_news_table ADD date_posted_int INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_news_table DROP COLUMN last_modified;

ALTER TABLE mantis_news_table CHANGE COLUMN last_modified_int last_modified INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_news_table DROP COLUMN date_posted;

ALTER TABLE mantis_news_table CHANGE COLUMN date_posted_int date_posted INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_bug_revision_table ADD timestamp_int INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_bug_revision_table DROP COLUMN timestamp;

ALTER TABLE mantis_bug_revision_table CHANGE COLUMN timestamp_int timestamp INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_bug_revision_table ADD INDEX idx_bug_rev_id_time (bug_id, timestamp);

SYSTEM WARNING: 'mysqli_real_escape_string() expects parameter 1 to be mysqli, boolean given' in '/srv/http/mantisbt/library/adodb/drivers/adodb-mysqli.inc.php' line 221
ALTER TABLE mantis_user_pref_table ADD timezone VARCHAR(32) NOT NULL DEFAULT '';

ALTER TABLE mantis_project_version_table ADD date_order_int INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_project_version_table DROP COLUMN date_order;

ALTER TABLE mantis_project_version_table CHANGE COLUMN date_order_int date_order INTEGER UNSIGNED NOT NULL DEFAULT 1;
<trim />
atrol
Site Admin
Posts: 8376
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: upgrading 1.2.1 -> 1.2.17

Post by atrol »

Maybe you are doing the same thing wrong like this guy
http://www.mantisbt.org/bugs/view.php?id=17565#c41014
Please use Search before posting and read the Manual
Xyem
Posts: 2
Joined: 02 Aug 2014, 20:00

Re: upgrading 1.2.1 -> 1.2.17

Post by Xyem »

atrol wrote:Maybe you are doing the same thing wrong like this guy
http://www.mantisbt.org/bugs/view.php?id=17565#c41014
I was :P

That option is.. weird. Why would you ever want it to print incorrect(!) SQL queries? I thought it was a "print as they are run so you can debug if it goes wrong" option.. because I only read "Print SQL queries" :)

PEBKAC issue indeed.
Post Reply