Page 1 of 1

Not able to upgrade to v1.3.1 from v1.2

Posted: 20 Sep 2016, 07:12
by codebuster
Hi Team,
During the pre-installation checks I am getting some database related errors. I am trying to upgrade my mantis (which is currently v1.2) to the new version (v1.3.1)
I am not able to proceed, I need help here to figure out how to go about this.
Steps followed for my upgrade
1. Downloaded the new package.
2. Took all necessary backup (existing code and database).
3. I set the database and hostname credentials in the config_inc.php file that is related to the current DB

Code: Select all

$g_db_type = 'mysqli';
$g_hostname = <myhostname>
$g_database_name = <mydbname>       //Just would like to mention here that my current Database is a MSSQL database
$g_db_username = <myusername>
$g_db_password = <mypassword>;
My server PHP version = 5.3.2
Following errors message is seen when g_dp_type = 'mysqli' : this is probably a default setting, but i just tried'
Database
Can open connection to database <mydbname> on host mssql_development with username test FAIL
Some tests failed. Please review and correct these failed tests before using MantisBT.

Possible solutions tried:
1. I changed the g_db_type variable to 'mssql'. But the I get the WARNING:
Database
PHP support for Microsoft SQL Server driver
'mssql' driver is no longer supported in PHP >= 5.3, please use 'mssqlnative' instead WARN

2. I changed the g_db_type variable to 'mssqlnative'. The the error is:
Database
Database type is supported by the version of PHP installed on this server
The current database type is set to mssqlnative. The version of PHP installed on this server does not have support for this database type. FAIL

I think I should be using the g_db_type = 'mssql', but it does not allow me to proceed. Please assist.

Re: Not able to upgrade to v1.3.1 from v1.2

Posted: 20 Sep 2016, 12:31
by obmsch
Hi Kris,

you have a running 1.2 with all the necessary settings in 'config_inc.php'. Move that to the subdir 'config' (new location in 1.3 for config files).

Add an entry (change the value!)
$g_crypto_master_salt = '1234567890123456'; # Random string of at least 16 chars, unique to the installation

In theory you should now be ready to upgrade. Alas there are some steps in 'schema.php' which will not work for MS SQLServer ('AlterColumnSQL' steps will fail).
(see: search.php?keywords=AlterColumnSQL&t=21339&sf=msgonly)

When I upgraded my installation recently I changed the affected steps (188, 189, 198, 206, 207, 208, 209) in 'schema.php' to null
and made those changes (after the upgrade, before the first use) manually in the database using 'SQL Server Management Studio'.

Martin

Windows 7 Prof SP1(32) - All Updates/Fixes applied (Locale: de-DE)
IIS 7.5
SQLServer Express 2012
PHP 7.0.11
Microsoft ODBC Driver 11
MS PHP Drivers for SQL Server PHP7 V4.1.2 (https://github.com/Microsoft/msphpsql/releases)
MantisBT 1.3.1 (Locale: Default)
SI-Plugins

Re: Not able to upgrade to v1.3.1 from v1.2

Posted: 21 Sep 2016, 11:38
by codebuster
Hi Martin,
I had actually already added this
$g_crypto_master_salt = '1234567890123456';
.
But here it seems like the code is giving me another error when I use the 'mssql' db_type

Fatal error: Call to a member function MoveNext() on boolean in <serverpath>/mantis/bugtracker/core/database_api.php on line 574
and this line 574 is

Code: Select all

$p_result->MoveNext();
I believe this is failing because there no handle in $p_result which is mainly because the database is not getting connected.

I had asked my internal IT Team to check if there is any issue with the DB connection with the hostname and password. However, the connection works with my old code and not with new one. Dont know what is going wrong here. :(

Re: Not able to upgrade to v1.3.1 from v1.2

Posted: 21 Sep 2016, 14:33
by dregad
In 1.3, we upgraded ADOdb (the underlying database library used by MantisBT) to a later version, that could explain why it was working in 1.2 and no longer in 1.3.

I'm not sure why you're trying to use mssql, it is no longer supported with PHP >= 5.3, and removed entirely in 7.0 (see http://php.net/manual/en/intro.mssql.php).
The current database type is set to mssqlnative. The version of PHP installed on this server does not have support for this database type. FAIL
You need to install the appropriate PHP database extension (probably sqlsrv in this case) for it to work.

Re: Not able to upgrade to v1.3.1 from v1.2

Posted: 22 Sep 2016, 06:25
by obmsch
I have used the native drivers from the get go, so I wasn't affected by the change dregad mentioned about adodb between 1.2 and 1.3.
You should use "$g_db_type = 'mssqlnative'" and the appropriate drivers(extensions) from MS.
Depending on your OS, SQLServer version, PHP version, http server there are different downloads.

(see: https://msdn.microsoft.com/en-us/librar ... .105).aspx about system requirements and
prerequisites/Microsoft ODBC Driver for SQL Server or SQL Server Native Client).

Re: Not able to upgrade to v1.3.1 from v1.2

Posted: 23 Sep 2016, 09:05
by codebuster
Hi obmsh, dregad,

Your suggestions were helpful for me indeed to figure out that the required drivers were not installed for our environment.
I have taken this further with the IT team to install the appropriate drivers and also the SQLServer also needs to be upgraded and the current version that we have does not support this version of mantis.

So the solution here is that I need to upgrade to a newer version of MSSQL server and the required database extension drivers for mssqlnative and that should do the thing. This will be done by our IT team and once that is ready I will re-initiate this process and get back if any help is needed.

I would like to conclude this topic here and sincere thanks to all those who helped me to get hints for this issue. :)

Best Regards,
Kris