WordPress – Fatal Error when upgrading your database

If you’ve just upgraded your WordPress installation to a new version, you may have been greeted with a rather scary looking error message:

Fatal error: Call to undefined method dbrc_wpdb::delete() in….wp-includes/option.php on line 370

You may be feverishly hunting the internet for a solution right about now. Hopefully that is what brought you here.

Fortunately, the fix should be fairly simple. If you are running a variation of the DB Cache plugin, this may be the cause of the problem. To fix it you’ll need to open your FTP client, browse to wp-content and copy db.php to your hard drive. Next, browse to your plugins folder and save your DB Cache plugin to your hard drive too.

Finally, delete the db.php file and the DB Cache folder from your site. Don’t worry, should anything go wrong you’ve got them backed up.

Reload the page with the error message on it and it should say “upgrade complete” and you’re good to go. (hopefully!)

Once again, I take no responsibility for your site should it go horribly wrong. All I can say is that it worked for me.

I found the hint here

Update

One helpful commenter suggested that you may get by with just deleting the db.php file. Try that first and if that doesn’t work, bin the DB Cache plugin too.

Update 2

Ivan, the creator of DB-Cache-Reloaded-Fix stopped by last night to inform me that his plugin had now been updated to be compatible with 3.4.  So, it should be safe to add it back in now if you deleted it.

Update 3

As it turns out, variations of this trick work with other cache plugins that may cause you similar error messages.  I recently installed an Object Cache plugin to use with XCache.  Unfortunately, the “Object Cache.php” file was causing a similar issue to DB Cache Reloaded Fix when I updated to WordPress 3.4.1.  The solution was to remove the Object Cache.php file until an update appears.

Update 4

This post was written for an issue that arose for me in WordPress 3.4. As we’ve moved on to newer versions and it’s still getting traffic, there’s clearly a need to keep this current. I’ve therefore removed 3.4 from the header.

88 thoughts on “WordPress – Fatal Error when upgrading your database

  1. Thank you SO MUCH for posting this!!! After 8 hours straight working on it yesterday – since no one in WordPress even admits this is a problem, nor does the plugin owner (at least in the forums), there is no answer there at all. And we who have had WP for a while know that help is very rare there now – but one kind person linked me to you.

    I deleted the plugin last night, but still got error line 94, and could NOT find it or remove it in MySql, which even mentioned the plugin by name, even though I’d deleted it! Deleting the db.php file worked instantly. Thanks again for saving my sanity.

  2. Hi Donna, thanks for your comment.
    I’d just like to say that if you scroll down (or up, I forget) there’s a comment from the plugin’s developer. The plugin was updated to support Wp3.4 after I posted this. Even so, removing the db.php file seems to do the trick for most people.

  3. Pingback: Wordpress 3.4.1 - Error Sewaktu Upgrade

  4. Thanks for the trick, but I’m a total newbie with WP (just installed it !) and something worries me now : what about the fact that there is no more db.php file now in the plugins folder ?

  5. Bruno, don’t worry. Db.php was installed by the db cache plugin and isn’t necessary for WordPress to run. Reinstalling the plugin with a newer version once your database has upgraded successfully puts the db file back in place.

  6. Pingback: Wordpress 3.4 にアップデートしたら管理画面に入れなくなった時の対処方法 | worstman.net/Blog

  7. Thank you very much for your answer. Actually, it seems to affect any language but it works without troubles with some web hosting and doesn’t with others

  8. Deleting just the db.php file worked great for me. That allowed for updating the database and getting back into the dashboard. At that point I disabled caching, updated the db plugin, enabled caching and all was well.

  9. Thanks !
    It worked well for me.
    After only 10min spent on WP, I am happy that I don’t have to contact assistance to fix the problem, and wait for their answer…
    Cheers,

    Thomas

  10. Ouff! Thank you very much. I’m new to WordPress, that was my 1st upgrade, I was starting to think )(*()}}**grrrr. :)

  11. Pingback: WordPress 3.5 “Elvin” --Wordpress.org - Techbeast.net

  12. J’ai un gros blême wp shop ne marche plus après la maj de wordpresse en version 3.5
    le msg d’erreur :
    Warning: Missing argument 2 for wpdb::prepare(), called in /homepages/14/d424851955/htdocs/lis67/wp-content/plugins/wpshop/includes/librairies/db/db_data_definition.php on line 254 and defined in /homepages/14/d424851955/htdocs/lis67/wp-includes/wp-db.php on line 990
    j’ai pas de wp_db.php nul-par sur le site si je désactive wp-shop le message disparaît mais j’ai plus boutique
    si quelqu’un à une idée
    merci

  13. Pingback: Réparer Wordpress après un Mise à Jour plantée

  14. After spending 8 hours trying in desperation to work out what I had done wrong with the WP update, eventually I simply pasted the first part of the error message into google, which threw out the breadcrumbs that eventually led me to this page. Great advice, and to an FTP first timer it was super simple to follow. Thanks.

Comments are closed.