wordpress upgrade failed. drops to install screen. database schema not upgraded

Bug #990615 reported by rob
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
wordpress (Ubuntu)
New
Undecided
Unassigned

Bug Description

After I upgraded from 10.04.3 to 12.04, wordpress started redirecting to the install.php install screen.

Digging through the mysql database, I saw nothing wrong as all the settings and posts were there. So I continued on the install screen, and entered the admin user & password. Now in mysql there are duplicate tables with a fresh install.

For example there is both the 'options' table with all the old options and a 'wp_options' table with the fresh install.

So it looks like the upgrade from Lucid to Precise failed to migrate the wordpress database to a new schema.

Revision history for this message
rob (4-launchpad-com-spm-egannetworks-com) wrote :

Update. As it seems that my wordpress instance does not have the 'wp_' prefix on most of the database tables, it was 3 new lines in the updated /etc/wordpress/wp-config.php that caused the problem:

if (!isset($table_prefix)) {
    $table_prefix = 'wp_';
}

The fix was to restore the wordpress database from backup and then add one line, setting $table_prefix to '' in my site's /etc/wordpress/config-default.php where the database passwords are.

$table_prefix = '';

And then run the Automatic Updater normally:
http://localhost/wordpress/wp-admin/update-core.php

Revision history for this message
Raphaël Hertzog (hertzog) wrote : Re: [Bug 990615] [NEW] wordpress upgrade failed. drops to install screen. database schema not upgraded

On Sat, 28 Apr 2012, rob wrote:
> Public bug reported:
>
> After I upgraded from 10.04.3 to 12.04, wordpress started redirecting to
> the install.php install screen.
>
> Digging through the mysql database, I saw nothing wrong as all the
> settings and posts were there. So I continued on the install screen,
> and entered the admin user & password. Now in mysql there are duplicate
> tables with a fresh install.
>
> For example there is both the 'options' table with all the old options
> and a 'wp_options' table with the fresh install.
>
> So it looks like the upgrade from Lucid to Precise failed to migrate the
> wordpress database to a new schema.

Hi,

This has nothing to do with a new schema but just with the $table_prefix
option. It's set to "wp_" by default in the precise package but AFAIK it
has been that way for a long time.

Are you sure you didn't have a specific configuration where the prefix was
set to empty ?

Can you attach the content of /etc/wordpress/ ?

Thus you can recover your former content by changing the wordpress
configuration in /etc/wordpress/wp-config.php and switching $table_prefix
to ''.

Cheers,
--
Raphaël Hertzog ◈ Debian Developer

Pre-order a copy of the Debian Administrator's Handbook and help
liberate it: http://debian-handbook.info/liberation/

Revision history for this message
rob (4-launchpad-com-spm-egannetworks-com) wrote :

Hi thanks for the clarification. I agree the problem was in the prefix, or lack thereof, of my database's wordpress tables.

I originally installed wordpress in Jan 2008 and have propagated the database all the way from 32-bit feisty to 64-bit lucid and, recently, precise. So sometime in the past 4 years the default 'wp_' prefix was set but didn't get applied to my mysql instance.

The fix that worked for me was to include $table_prefix=''; in my /etc/wordpress/config-default:

<?php

define('DB_NAME', 'wordpress');
define('DB_USER', 'wordpress');
define('DB_PASSWORD', '***my*password*here****');
define('DB_HOST', 'localhost');

$table_prefix = '';

?>

Incidentally only some of the wordpress tables have the wp_ prefix on my system.

mysql> use wordpress
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables
    -> ;
+----------------------+
| Tables_in_wordpress |
+----------------------+
| commentmeta |
| comments |
| links |
| options |
| postmeta |
| posts |
| term_relationships |
| term_taxonomy |
| terms |
| usermeta |
| users |
| wp_email_list |
| wp_email_list_config |
| wp_email_list_future |
+----------------------+

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.