Tuesday, November 6th, 2007
How to force a Wordpress database upgrade
There are times when you will need to force a database upgrade in Wordpress, unfortunately, this did not really solve my problem of fixing “WordPress database error: [Table ‘mydatabase.wp_post2cat’ doesn’t exist]” (see this post for the solution), but for those who may need to “force” an upgrade, this is how you do it.
Basically, what Wordpress does is check an option it stores in your blogs database for your db_version. What you need to do is manually edit record called “db_version” located in “wp_options” in your Wordpress database. (I used phpmyadmin to edit mine).
Be careful tho’ the database version does not equal the Wordpress version. See the following to get the right setting for you. Without having to look too much into Wordpress’ upgrading system I could say that it would be safe to change the value to match your previous version. (I used “5183″ since I’ upgraded from Wordpress 2.2.x).
- For Wordpress version 2.3 use 6124
- For Wordpress version 2.2 and 2.2.x use 5183
- For Wordpress version 2.1.x use 4773
- For Wordpress version 2.1 use 4772
- For Wordpress version 2.0 and 2.0.x use 3441
- For Wordpress version 1.5.x use 2541
- For Wordpress version 1.x use 2540
Wordpress should detect that your database version is lower, then assumes that your database is out-of-date and insists on an upgrade - which should be fine for you, you want it to upgrade in the hopes that Wordpress creates the database tables you are missing.
After forcing the upgrade, you are flashed with an upgrade complete message and there you have it, a forced database upgrade for Wordpress.
on Tuesday, October 28th, 2008 at 3:41 am:
This is great info to know.