WordPress.org

Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#2435 closed defect (bug) (invalid)

Changing table prefix in wp-config doesn't update database

Reported by: MtDewVirus Owned by:
Milestone: Priority: high
Severity: normal Version: 2.0.1
Component: Administration Keywords: table prefix database rename update
Focuses: Cc:
PR Number:

Description

Changing the table prefix in wp-config.php doesn't update the database.

xx_user_level and xx_capabilities in table xx_usermeta are created with xx being the table prefix. The same with xx_user_roles in table xx_options.

When updating the table prefix, these names are not updated, so WP cannot read user permissions. After manually renaming them, permissions worked again.

Change History (2)

#1 @davidhouse
14 years ago

We could detect a table prefix that isn't consistent with a table_prefix option in the DB, and update those options if they don't match up.

#2 @skeltoac
14 years ago

  • Resolution set to invalid
  • Status changed from new to closed

Should it? How should it? The prefix is not stored in a setting so WP has no memory of it. Alas, changing the prefix makes WP load a different set of tables, so it wouldn't be able to see the old setting anyway unless you had manually renamed or moved the tables...

You might want to write a script that completes the move to a new prefix but this isn't something WP needs IMO.

Note: See TracTickets for help on using tickets.