Migrate from 7.14.3 to 8.5.1 using iis

Hi there
I’m tring to install SuiteCRM 8.5.1 or migrate from 7.14.3 using iis and mssql.
It installed without problem but no navbar, and as I read here there is no solution for now. Then I tried migrate. I installed SuiteCRM 7.14.3 successfully then after all topics I read, I used legacy config and public config, I changed database server to locallhost, 127.0.0.1 and the name that sqlserver procedure gave to me, I tried telnet and it connected to db and all I could do that community topics said that.
After all when I run this command:

php C:\Sources\CRM8m\bin\console suitecrm:app:setup-legacy-migration

the resault is this:

I’m using:
Windows Server 2022
iis 10.0.20348
php 8.2.12
SQL Server 2022
and 8.5.1 Migrate from 7.14.x

Your MySQL server is crashing (not just giving an error). This is usually not a problem with SuiteCRM, but rather with the DB server itself…

What’s your max_allowed_packet value? in (my.ini/my.cnf)

Also check the wait_timeout value - increase both if they’re low and attempt again.

What’s resource monitor looking like when you try and attempt the command? Is the RAM ramping up to full load and then stop?

Restart your SQL Server after making these changes else it won’t take hold

Services > MYSql > Restart

Dear @pgr @dhuntress
I do not use mysql! I’m using sql server.

There is an error in your screenshot saying specifically “MySQL server has gone away”…

I know but don’t know why.
I installed SuiteCRM 7.14.3 using SQL Server and it works well.
When I try to migrate, my error was that.
I used this config for migrate:
Public folder: web.config

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <clear />
                <rule name="public/index.php" enabled="true" stopProcessing="false">
                    <match url="^(.*)$" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_URI}" matchType="Pattern" pattern="^/legacy" ignoreCase="true" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php/{R:1}" appendQueryString="true" />
                </rule>
            </rules>
        </rewrite>
        <defaultDocument enabled="false" />
		<staticContent>
			<remove fileExtension=".webmanifest" />
			<mimeMap fileExtension=".webmanifest" mimeType="application/json" /> 
		</staticContent>
    </system.webServer>
</configuration>

legacy folder(based on installed suitecrm 7.14.3):
add this config to web.config:

<rule name="legacy/index.php" enabled="true" stopProcessing="false">
                    <match url="^(.*)$" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php/{R:1}" appendQueryString="true" />
                </rule>
   </rules>

config_override.php:

<?php
/***CONFIGURATOR***/
/***CONFIGURATOR***/
$sugar_config['dbconfig']['db_host_name'] = 'WIN-GKDBNR7SK5M';
$sugar_config['dbconfig']['db_user_name'] = 'sa';
$sugar_config['dbconfig']['db_password'] = '*******';
$sugar_config['dbconfig']['db_host_instance'] = 'web';
$sugar_config['dbconfig']['db_name'] = 'crm7';
$sugar_config['dbconfig']['db_type'] = 'mssql';
$sugar_config['dbconfig']['db_port'] = '1433';
$sugar_config['dbconfig']['db_manager'] = 'SqlsrvManager';

and this for database in config.php:

'dbconfig' => 
  array (
    'db_host_name' => 'WIN-GKDBNR7SK5M',
    'db_host_instance' => 'web',
    'db_user_name' => 'sa',
    'db_password' => '*******',
    'db_name' => 'crm7',
    'db_type' => 'mssql',
    'db_port' => '1433',
    'db_manager' => 'SqlsrvManager',
    'collation' => 'utf8mb4_general_ci',
    'charset' => 'utf8mb4',
  ),
  'dbconfigoption' => 
  array (
    'persistent' => true,
    'autofree' => false,
    'debug' => 0,
    'ssl' => false,
    'collation' => 'utf8mb4_general_ci',
    'charset' => 'utf8mb4',
  ),

then I ran this:

PS C:\Windows\system32> php C:\Sources\CRM8m\bin\console suitecrm:app:setup-legacy-migration

I don’t know why my error is about MySQL!!!

There is no solution?

Do you have any DB configuration in

.env
.env.local

or any other .env*

?

I add .env.local file(dose not exists) with this line:

DATABASE_URL="mssql://sa:********@WIN-GKDBNR7SK5M:1433/crm7"

Well, tell us what happened when you added that.

You really need to resolve that MySQL error, or understand where it’s coming from, because it is a very strange thing to have occuring when you’re using a different database…

After adding .env.local nothing! Still same error.
I checked all MySQL words in project and nothing.
I’m realy confused.
Even to check config, I add log like this:

/**
     * @inheritDoc
     */
    public function execute(array &$context): Feedback
    {
        $config = $this->handler->loadLegacyConfig();

        $inputs = [];
        $inputs['db_password'] = $config['dbconfig']['db_password'] ?? '';
        $inputs['db_username'] = $config['dbconfig']['db_user_name'] ?? '';
        $inputs['db_name'] = $config['dbconfig']['db_name'] ?? '';
        $inputs['db_host'] = $config['dbconfig']['db_host_name'] ?? '';
        $inputs['db_port'] = $config['dbconfig']['db_port'] ?? '';
        $inputs['db_type'] = $config['dbconfig']['db_type'] ?? 'mysql';
        error_log(print_r($inputs,true), 3, "C:\Sources\CRM8m\logs\mine.log");
        $inputsValid = $this->validateInputs($inputs);
        .
        .
        .
        return $feedback;
    }

in setupEnv.php and result was:

(
    [db_password] =>*******
    [db_username] => sa
    [db_name] => crm7
    [db_host] => WIN-GKDBNR7SK5M
    [db_port] => 1433
    [db_type] => mssql
)

All is true.

There are (sort of) two different apps inside SuiteCRM v8:

  • the legacy app which uses the config.php information for DB access
  • the Symfony back-end of the v8 app, which uses the .env information.

your error seems to be coming from here, which strangely enough, has a reference to mysql and doesn’t seem to contemplate MSSQL at all…

Yes, exactly it is.
I changed

"mysql:host=" . $hostString . ";",

to

$inputArray['db_type'].":host=" . $hostString . ";",

and error changed to

 ERROR     [app] An error occurred while checking the Database Host Connection could not find driver

I’ll try to resolve this error and know how to set mssql driver. If you know how can I resolve this problen please help me.
I’m very grateful for your help. :slightly_smiling_face:

1 Like

You probably need to install and enable a MSSQL module in your PHP. This is not a SuiteCRM issue, I am sure you will find help online about it.

EDIT: I would also like to fix the file so that this error is fixed in the app for everybody. But I see more references to mysql in that file, and I don’t want to change them blindly, and it’s not easy for me to set up a testing environment for all this. Can you try making the rest of the necessary changes in that file and test if they work? Then we can put that up on Github.

I’ll try. Thanks for help.