• Welcome to Simple Machines Community Forum. Please login or sign up.
November 27, 2021, 03:48:48 PM

News:

Wondering if this will always be free?  See why free is better.


Migrating from one server to another

Started by davecove, June 07, 2020, 11:44:17 AM

Previous topic - Next topic

davecove

I am moving a 2.0.9 forum from a CentOS server to a new Ubuntu 18.04 VM loaded with Apache 2.4.29, PHP 7.2.24, and MySQL 14.14.

Thus far I have moved all of the files, exported and imported the database, and edited the Subs-Db-mysql.php to use mysqli_ instead of mysql_.

When I go to the forums index.php I get:

    Connection Problems
    Sorry, SMF was unable to connect to the database. This may be caused by the server being busy. Please try again later.

This generates no errors in the php errors.log file.

To troubshoot I wrote this to test connectivity:


   <?php

    require('Settings.php');

    echo 'DB Test</br>';
    echo $db_server . '</br>';
    echo $db_user . '</br>';
    echo $db_passwd . '</br>';
    echo $db_name . '</br>';

    $conn = mysqli_connect($db_server,$db_user,$db_passwd, $db_name);

    if (!$conn)
    {
        echo "Fail" . '</br>';
        echo "ERRNO: " . mysqli_connect_errno() . '</br>';
        echo "ERROR: " . mysqli_connect_error() . '</br>';
    }
    else
    {
        echo "Connection Sucess" . '</br>';
    }

    if (mysqli_select_db($conn, $db_name))
    {
        echo "Success setting selected database to " . $db_name . '</br>';
    }
    else
    {
        echo "Failed to set selected database to " . $db_name . '</br>';
    }


    if ($result = mysqli_query($conn, "SELECT DATABASE()"))
    {
        $row = mysqli_fetch_row($result);
        echo "Default database is " . $row[0] . '</br>';

        mysqli_free_result($result);
    }
    else
    {
        echo "Failed to fetch cutrent database"; '</br>';
    }
    ?>


The results of loading the file in the browser are encouraging:

DB Test
localhost:3306
smf_db_user
*********
smf_new
Connection Success
Success setting selected database to smf_new
Default database is smf_new

So, where can I look for more t-shooting details.  I have no clues to work from at this point.

Dave

vbgamer45

You need to have your SMF forum upgraded. 2.0.9 does not support PHP 7.2
Or downgrade your PHP version.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Doug Heffernan

The connection error points either to a server issue, or the db info are not set correctly/permission issue.


P.s. Php 7 is not supported by 2.0.13 and below afaik. If you can not downgrade the php version, overwrite your forum files with those from the large upgrade 2.0.17 package, minus the upgrade.php and .sql files.

davecove

Quote from: vbgamer45 on June 07, 2020, 11:59:07 AM
You need to have your SMF forum upgraded. 2.0.9 does not support PHP 7.2
Or downgrade your PHP version.

What PHP version would you suggest? Would 5.6 work?

Dave

vbgamer45

I believe so give it a shot.
Then upgrade to SMF 2.0.17 tough the patches using the package manager then you can use PHP 7.2
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

davecove

Quote from: vbgamer45 on June 07, 2020, 12:19:02 PM
I believe so give it a shot.
Then upgrade to SMF 2.0.17 tough the patches using the package manager then you can use PHP 7.2

Downgrading to PHP 5.6 and copying the files from the old server to the new server again did the trick.

Now I can start patching up to 2.0.17 with the admin panel.

Thanks!

shadav

maybe a silly question but did you change your settings.php files and update the old database info with the new database info
or using the repair tool: https://wiki.simplemachines.org/smf/Repair_settings.php

davecove

Quote from: shadav on June 07, 2020, 02:21:08 PM
maybe a silly question but did you change your settings.php files and update the old database info with the new database info
or using the repair tool: https://wiki.simplemachines.org/smf/Repair_settings.php

Thank you for suggesting that. It cleared up another issue I was having.

Dave

Kindred

BTW: If you manually made edits to sqli, then the package updates may not perform cleanly
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.<br /><br />"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: