No announcement yet.

Database error when upgrading from 4.2 to 5.0.5 [Solved]

  • Filter
  • Time
  • Show
Clear All
new posts

  • Database error when upgrading from 4.2 to 5.0.5 [Solved]

    I'm sharing this because I literally spend the last 3 days solid trying to figure this out and I'm hoping someone else might benefit from my headaches.

    We are migrating our forums from phpBB 3.0.11 to vBulletin and needed to import all of our current data for use in the new forums. After purchasing a license for vB 5 Connect, I then installed 4.2 on our web server (because Impex only imports to 4.x right now, not 5) with a fresh database. A copy of our phpBB database was also installed.

    After fully installing and importing everything into the fresh vB 4.2 environment and confirming the import was successful, I made a web file and database back-up and began the process of upgrading to 5.

    Note that we have NO plugins/mods/themes installed at this time.

    Following the instructions included in the package for 5, I created my new config files locally (with new cookie prefixes to keep conflicts from happening) and then uploaded everything into a new /vb5/ subdirectory on the server. All of my apache configs were set to point to the new location, as was the config file, and when everything was ready, I went to the /install/upgrade.php file to get the process going. But I was greeted with a blank browser window and the following error in my email:

    Database error in vBulletin 4.2.2:
                            Invalid SQL:
                                    SELECT COUNT(*) AS postcount
                            FROM node;
                            MySQL Error   : Table 'vbforums.node' doesn't exist
                            Error Number  : 1146
                            Request Date  : Saturday, February 8th 2014 @ 10:53:37 AM
                            Error Date    : Saturday, February 8th 2014 @ 10:53:38 AM
                            Script        : http:///vb5/core/install/upgrade.php
                            Referrer      :
                            IP Address    :
                            Username      :
                            Classname     : vB_Database_MySQL
                            MySQL Version : 5.5.31-0+wheezy1
    So I logged in to mysql and did a #show tables; command on the database - sure enough, there was no node table.

    But at least it told me where the problem was. Kind of.

    A search on the /core/install/ directory lead me to the file /core/install/includes/class_upgrade_ajax.php and line #200 where there's a function to check the size of the database. In it is this:

    PHP Code:
    $postcount $this->registry->db->query_first("
                    SELECT COUNT(*) AS postcount
                FROM " 
    TABLE_PREFIX "node") ;

    Well, I don't have that table. I do have one that would satisfy the function though, called "posts" so looked into that table and found the postid column. Perfect! I edited the above code to:

    PHP Code:
    $postcount $this->registry->db->query_first("
                    SELECT postid AS postcount
                FROM " 
    TABLE_PREFIX "post") ;

    Then I uploaded the file and BOOM. The upgrade tool loaded!

    I did get a few other mysql errors emailed to me but they did not halt or error out the upgrade script, and my upgrade was successful.

    Hopefully this helps someone else!

  • #2
    Thank you for your to help others topics


    • tshipps
      tshipps commented
      Editing a comment
      No problem!

  • #3
    Thanks, this was for me also the solution!


    Related Topics