View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0008846 | mantisbt | upgrade | public | 2008-02-01 03:53 | 2009-06-26 12:00 |
| Reporter | daudo | Assigned To | thraxisp | ||
| Priority | normal | Severity | block | Reproducibility | always |
| Status | closed | Resolution | no change required | ||
| Product Version | 1.1.1 | ||||
| Summary | 0008846: database upgrade from 1.0.8 -> 1.1.1 not working | ||||
| Description | I am trying to upgrade our debian 1.0.8 installation to the vanilla 1.1.1 version but have failed in the course of database upgrade. If I go to /admin/upgrade.php various upgrade steps are shown as required (=red). The advances upgrade view shows that many things have obviously found as already applied but "many" of the red ones are not applicable because they have already been incorporated. Please see the attached screenshot for a visual example of what I get. | ||||
| Additional Information | From what I know, the following query should return something reasonable: select * from mantis_config_table where config_id='database_version'; But in our case that does not give anything, so maybe that's the reason. | ||||
| Tags | No tags attached. | ||||
| Attached Files | |||||
|
Hmm, I just browsed some other bugs on that subject and found that I should use /admin/install.php instead. So after running install.php & entering the required information, I get an error telling me that "mantis_config_table" already exists. Please see the second screenshot for that. |
|
|
Ok, and finally I found that comment 16805 from 0008808 looks like exactly where I fail now. In 0008808 giallu mentions that the problem could be due to running install.php after having run upgrade.php before. So I dropped & recreated my mantis test install & ran /admin/install.php right as the first script, yet still no change. |
|
|
This may be a problem in the debian installer. I've referred it to the packager for help. |
|
|
Hi, I am the maintainer of mantis for Debian. Indeed there are known issues with upgrading from a debian installation to 1.1.x which about I already nagged thraxisp 2 weeks ago :) Well, the reply (and the solution) were yet outstanding. I must confess, that the mantis developers and I have some different opinions about how (database) upgrades should be handled. Therefore the current upgrade path (as I use it) is quiet hackish in the sense that I'm using the Print SQL Queries function in the upgrader to generate SQL statements for the package-integrated update routine and therefore must hope that the sql statements generated are right, but cannot be sure. However due to this bug report thraxisp came back to me, asking if I can confirm that the mantis_config_table is not created due to upgrading. But I can't confirm this. Just to give a status in between. Best Regards, |
|
|
Thanks for your responses so far. From the devel list I am aware of the different opinions on how (major) upgrades should be handled, yet the only thing that counts at the end is if the upgrade works at all. And in that case it seems that it is not working at all in my case(tm). But back to my problem: First I am not upgrading using any debian package, because there is none yet for 1.1.1. Instead I am using the tar.gz downloadable from sf.net. However, from my debian 1.0.8 installation I do have a mantis_config_table, but it lacks the "database_version" entry, so maybe that's the problem: mysql> select * from mantis_config_table where config_id='database_version'; mysql> select count() from mantis_config_table; |
|
|
The following command is missing from the Debian 0.19 to 1.0.6 MySQL upgrade script: INSERT INTO mantis_config_table ( value, type, access_reqd, config_id, project_id, user_id ) VALUES ('52', 1, 90, 'database_version', 20, 0 ); Running this command and then running the admin/install.php should upgrade your installation. |
|
|
hmm, I am afraid that inserting the row does not change anything. I am still stuck with the same message as before: ------CUT------- |
|
|
Ok, digging a bit deeper inside admin/install.php I found this: line 137 in core/constant_inc.php looks like this: line 668 in in admin/install.php line 668 looks like this: lines 95 to 105 in core/config_api.php look like this: In other words, for the 'database_version' config parameter, $g_cache_config is populated like this: lines 113 to 118 in core/config_api.php look like this: @@ debug @@ echo "clu found u=$t_user, p=$t_project, v=$t_value ";} That said, it is obvious that 'database_version' is not found for the "ALL_PROJECTS"-project (ALL_PROJECTS = 0) because in your statement from comment 16924 above database_version is explicially registered for project_id 20. So either core/config_api.php needs to be extended to test for ALL_PROJECTS as well or the INSERT statement is wrong. And indeed, after changing the INSERT statement from above to ... ... the upgrade works. |
|
|
sigh Indeed, this works for installations that were upgraded from 0.19x to 1.0.x and are now to be upgraded to 1.1.x. Unfortunately the solution is a bit different is probably a bit different if upgrading from 1.0.x to 1.1.x. |
|
|
daudo, you are correct. I made an error in the SQL command. |
|
|
I checked the repository for both 1.1.x and 1.2.x, both include the line setting the 'database version' parameter as the last line of the printed SQL queries. |
|
|
It appears that the Debian Etch (1.1.2) installer forgets to set this config entry as well. I'll add a bug downstream. |
|
|
No, thats wrong. First of all: Debian Etch does not contain mantis at all. Second: The bug with the missing database_version has been fixed in 1.1.2 version of the package. The SQL statements for the upgrade include: INSERT INTO A similar statement is executed on installation. |
|
|
I'm getting this same problem upgrading Mantis from 1.1.1 to 1.2.0a2. I need to use 1.2x because I want to integrate SVN and Git with Mantis. |
|
|
The insert statement doesn't worked, because in my case that line already exists. I tried to change the version to 52 as adviced on issue 0009798 and didn't worked, got the same error message. |
|
|
Hint: It is possible to delete rows before adding them. |
|
|
Yeah, right... |
|
|
I drop this table and try to do the update again and got another error: I've checked the database and the table is there again. |
|
|
Allan, If you drop me an email to paul@mantisforge.org I can probably help you out. I run mssql at work using odbc_mssql as the database driver. Paul |
|
|
I'm marking this issue as resolved, as from what I can tell, daudo's original case related to mysql and is now working. If i'm incorrect in this please reopen so we can help you out. Thanks |
|
|
well, just for the archaeologists that will once dig out this bug: it was not mysql related but a problem with the debian package instead. |
|
|
Hi! We can't reopen, so I'll just add some notes. 1) 0008808 is related to this issue as well I think That didn't work out of the box. I got the above mentioned BAD error. Logical, since that table already exists, as do all the following to-be-created tables. I had to use the 'Print SQL queries instead of executing' and skip the CREATE TABLE and INDEX statements and only apply the queries after those. This of course, leaves me wondering whether everything is upgraded. I should check the CREATE TABLE queries with what I had in de database, but as the later queries change the mentioned CREATE TABLE queries, I guess that it's ok... But I could only come up with this yet-to-be-tested solution after reading the manual, some forum posts, and finally this issue (and the related issues)... That is not as it should be I think? |
|
|
Eric, If this issue is due to a fault debian package - please contact debian to see if they have released a fixed package. They are probably in a better position to identify what parts of the database schema our install scripts generate were missed by their package. Paul |
|