No announcement yet.

Database error when upgrading from 4.2 to 5.0.5 [Solved]

  • Filter
  • Time
  • Show
Clear All
new posts

  • aberg
    Thanks, this was for me also the solution!

    Leave a comment:

  • tshipps
    commented on 's reply
    No problem!

  • anwar513
    Thank you for your to help others topics

    Leave a comment:

  • 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:

    [COLOR=#222222][FONT=arial]Database error in vBulletin 4.2.2:[/FONT][/COLOR]
    [COLOR=#222222][FONT=arial]                        Invalid SQL:[/FONT][/COLOR]
    [COLOR=#222222][FONT=arial]                                SELECT COUNT(*) AS postcount[/FONT][/COLOR]
    [COLOR=#222222][FONT=arial]                        FROM node;[/FONT][/COLOR]
    [COLOR=#222222][FONT=arial]                        MySQL Error   : Table 'vbforums.node' doesn't exist[/FONT][/COLOR]
    [COLOR=#222222][FONT=arial]                        Error Number  : 1146[/FONT][/COLOR]
    [COLOR=#222222][FONT=arial]                        Request Date  : [/FONT][/COLOR][COLOR=#222222][FONT=arial]Saturday, February 8th 2014[/FONT][/COLOR][COLOR=#222222][FONT=arial] @ 10:53:37 AM[/FONT][/COLOR]
    [COLOR=#222222][FONT=arial]                        Error Date    : [/FONT][/COLOR][COLOR=#222222][FONT=arial]Saturday, February 8th 2014[/FONT][/COLOR][COLOR=#222222][FONT=arial] @ 10:53:38 AM[/FONT][/COLOR]
    [COLOR=#222222][FONT=arial]                        Script        : http:///vb5/core/install/[/FONT][/COLOR][COLOR=#222222][FONT=arial]upgrade.php[/FONT][/COLOR]
    [COLOR=#222222][FONT=arial]                        Referrer      :[/FONT][/COLOR]
    [COLOR=#222222][FONT=arial]                        IP Address    :[/FONT][/COLOR]
    [COLOR=#222222][FONT=arial]                        Username      :[/FONT][/COLOR]
    [COLOR=#222222][FONT=arial]                        Classname     : vB_Database_MySQL[/FONT][/COLOR]
    [COLOR=#222222][FONT=arial]                        MySQL Version : 5.5.31-0+wheezy1[/FONT][/COLOR]
    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!

Related Topics