updating to 1.2 version problem

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
angrybambr
Posts: 7
Joined: 12 May 2010, 10:52

updating to 1.2 version problem

Post by angrybambr »

Hello all,
I have Mantis 1.0.7 database running on MySQL server.
I need to update it to 1.2 version.
My steps:
1) Unpack Mantis1.2 to my webserver htdocs/mantis12 folder
2) run mantis12/admin/install.php
I can see only new installation option, but not update. Ok, I submit form and new bugtracker database is appears.
3) I run again mantis12/admin/install.php
now I can see update options. I submit form and can see message about successful finishing, but bugtracker database is still clean
What I'm doing wrong ?

Sorry for english, it's not my native.
atrol
Site Admin
Posts: 8536
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: updating to 1.2 version problem

Post by atrol »

after step 1) copy your old config_inc.php to the new directory before starting step 2)
Please use Search before posting and read the Manual
angrybambr
Posts: 7
Joined: 12 May 2010, 10:52

Re: updating to 1.2 version problem

Post by angrybambr »

atrol wrote:after step 1) copy your old config_inc.php to the new directory before starting step 2)
i don't have old config_inc.php file. I have only database
atrol
Site Admin
Posts: 8536
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: updating to 1.2 version problem

Post by atrol »

Does this mean that you have no access to the old installation?
There must be a config_inc.php
Please use Search before posting and read the Manual
angrybambr
Posts: 7
Joined: 12 May 2010, 10:52

Re: updating to 1.2 version problem

Post by angrybambr »

atrol wrote:Does this mean that you have no access to the old installation?
There must be a config_inc.php
yes, i have only database backup that was restored to mysql server
atrol
Site Admin
Posts: 8536
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: updating to 1.2 version problem

Post by atrol »

you could create one, which should look like this

Code: Select all

<?php
	$g_hostname = 'yourHost';
	$g_db_type = 'mysql';
	$g_database_name = 'yourDatabaseName';
	$g_db_username = 'yourDatabaseUser';
	$g_db_password = 'yourDatabasePassword';
?>
Or make a fresh dummy installation which you throw away later. This will create a config_inc.php. After changing the database parameters you can use this for the instance you want to update.
Please use Search before posting and read the Manual
angrybambr
Posts: 7
Joined: 12 May 2010, 10:52

Re: updating to 1.2 version problem

Post by angrybambr »

Thanks. It works, but now i have another problem.
My mantis 1.0.7 database is very big (about 8 Gigabytes) and when I start update i can see that database is modifying. It takes about 30-40 minutes but after that I can see only "HTTP 500 Internal Server Error" in Internet Explorer and database update is not finishing correctly. I think the problem is in configuration php/apache files?

Code: Select all

Apache access.log
127.0.0.1 - - [13/May/2010:09:06:42 +0100] "GET /mantis12/admin/install.php HTTP/1.1" 200 892 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; WOW64; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)"
127.0.0.1 - - [13/May/2010:09:06:53 +0100] "POST /mantis12/admin/install.php HTTP/1.1" 500 - "http://localhost/mantis12/admin/install.php" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; WOW64; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)"
apache error.log is empty
php_errors.log is empty

What should i do with it ?
angrybambr
Posts: 7
Joined: 12 May 2010, 10:52

Re: updating to 1.2 version problem

Post by angrybambr »

I found where update script executing is stopped. I enabled logging queries in mysql server.

Code: Select all

UPDATE mantis_bug_history_table SET date_modified_int=1223899762 WHERE id=616049
Executing stop after great number of queries like this. there no errors in log file. I think there problem with timeouts in mysql/apache/php. Can anybody tell me what can i do with it ?

PS. I found at internet advice to insert

Code: Select all

<?php  
  set_time_limit(0);  
?> 
to very beginning of php-script, but it didn't help :(
atrol
Site Admin
Posts: 8536
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: updating to 1.2 version problem

Post by atrol »

Try setting the following parameter in php.ini
http://www.php.net/manual/en/info.confi ... ution-time

Maybe Apache has also to be customized
http://httpd.apache.org/docs/2.2/en/mod ... ml#timeout

Size of database 8GB ?
Could you share information about number of users / projects / issues ?
Do you store your attachments in database?
Please use Search before posting and read the Manual
angrybambr
Posts: 7
Joined: 12 May 2010, 10:52

Re: updating to 1.2 version problem

Post by angrybambr »

Yes, size of database 8GB.
My table mantis_bug_history_table has more than one million records and my server can't execute sql query with million lines. It hung on 660 000 record. May be it is buffer overflow in mysql or something else... I think mantis team should batch sql queries with, for example, 1000 or 10000 lines in one query.

I delete lines:

Code: Select all

$upgrade[] = Array( 'UpdateFunction', "date_migrate", array( 'mantis_bug_history_table', 'id', 'date_modified', 'date_modified_int' ) );
$upgrade[] = Array( 'DropColumnSQL', Array( db_get_table( 'mantis_bug_history_table' ), "date_modified" ) );
$upgrade[] = Array( 'RenameColumnSQL', Array( db_get_table( 'mantis_bug_history_table' ), "date_modified_int", "date_modified", "date_modified_int		I  UNSIGNED     NOTNULL DEFAULT '1' " ) );
from file admin/schema.php and wrote my own little script to do the same but not with one huge query:

Code: Select all

<?php 
echo "begin.. <br />";
require_once( dirname( dirname( __FILE__ ) ) . DIRECTORY_SEPARATOR . 'config_inc.php' );
$database = mysql_connect ($g_hostname,$g_db_username,$g_db_password);
mysql_select_db($g_database_name,$database);
$query = "select id, date_modified  from mantis_bug_history_table";
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
while ($row = mysql_fetch_array($result)) { 
	$date_to_unixtime = strtotime($row['date_modified']);
	$query2 = "UPDATE mantis_bug_history_table SET date_modified_int=".$date_to_unixtime." WHERE id=".$row['id'];
	$result2 = mysql_query($query2) or die('Query failed: ' . mysql_error());
	}
$query = "ALTER TABLE mantis_bug_history_table DROP date_modified";	
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
$query = "ALTER TABLE mantis_bug_history_table CHANGE date_modified_int date_modified INT( 10 ) UNSIGNED NOT NULL DEFAULT '1'";	
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
echo "done.. <br />";
?>
and it works. I'll try to configure timeouts and buffer size in mysql server again.. if it will not help, I'll use my script on production..
Post Reply