Advertisement:

Author Topic: Migrating from one server to another  (Read 321 times)

Offline davecove

  • Newbie
  • *
  • Posts: 8
Migrating from one server to another
« on: June 07, 2020, 11:44:17 AM »
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

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 22,654
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Migrating from one server to another
« Reply #1 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.
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

Offline Doug Heffernan

  • Full Member
  • ***
  • Posts: 572
    • An Unofficial King of Queens Forum
Re: Migrating from one server to another
« Reply #2 on: June 07, 2020, 12:02:45 PM »
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.

Offline davecove

  • Newbie
  • *
  • Posts: 8
Re: Migrating from one server to another
« Reply #3 on: June 07, 2020, 12:09:55 PM »
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

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 22,654
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Migrating from one server to another
« Reply #4 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
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

Offline davecove

  • Newbie
  • *
  • Posts: 8
Re: Migrating from one server to another
« Reply #5 on: June 07, 2020, 12:50:42 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!

Offline shadav

  • Full Member
  • ***
  • Posts: 437
  • Gender: Female
    • Ask The Muslims: A Place To Ask Honest Questions and Receive Respectful Answers
Re: Migrating from one server to another
« Reply #6 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

Offline davecove

  • Newbie
  • *
  • Posts: 8
Re: Migrating from one server to another
« Reply #7 on: June 08, 2020, 05:34:36 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

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 59,309
  • Gender: Male
    • Kindred-999 on GitHub
Re: Migrating from one server to another
« Reply #8 on: June 08, 2020, 06:18:43 PM »
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.