Title: Renaming SQL Tables
Last modified: August 18, 2016

---

# Renaming SQL Tables

 *  Resolved [RogerUsh](https://wordpress.org/support/users/rogerush/)
 * (@rogerush)
 * [19 years, 11 months ago](https://wordpress.org/support/topic/renaming-sql-tables/)
 * Does anyone know how rename sql tables throughout an existing WP page? I want
   to install another version of WP on my site with different table prefixes and
   I wanted to change the prefix of the older tables to match the current sequence.
 * I tried out right changing the prefix of the old tables and changing the prefix
   setting in config.php, but when trying to access the old page it says:
 * > `It doesn't look like you've installed WP yet. Try running install.php.`
 * I backed everything up and tried running `install.php`, but then it gave me this
   error:
 * > WordPress database error: [You have an error in your SQL syntax; check the 
   > manual that corresponds to your MySQL server version for the right syntax to
   > use near '01-v3_categories ( cat_ID bigint(20) NOT NULL auto_increment, cat_name
   > varch' at line 1]
   >  CREATE TABLE 01-v3_categories ( cat_ID bigint(20) NOT NULL
   > auto_increment, cat_name varchar(55) NOT NULL default '', category_nicename
   > varchar(200) NOT NULL default '', category_description longtext NOT NULL, category_parent
   > int(4) NOT NULL default '0', PRIMARY KEY (cat_ID), KEY category_nicename (category_nicename))
 * Any help would be appreciated!
 * -Rog

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [19 years, 11 months ago](https://wordpress.org/support/topic/renaming-sql-tables/#post-407876)
 * You took quite a complicated route…
    It was a bad idea to touch the old DB.
 * All you have to do for a new install in the same database: change the table prefix
   in the wp-config.php file for the new install. Done.
 *  Thread Starter [RogerUsh](https://wordpress.org/support/users/rogerush/)
 * (@rogerush)
 * [19 years, 11 months ago](https://wordpress.org/support/topic/renaming-sql-tables/#post-407887)
 * Well I got the old WP working again, with the old prefix, but now I’m getting
   the same error when trying to install the new imprint.
 * [topic 76939](http://wordpress.org/support/topic/76939)
 * I know I was making it needlessly complicated, but I guess I was trying to give
   myself a challenge and learn something new. I think that something new is “if
   it ain’t broke, don’t fix it”.
 *  Thread Starter [RogerUsh](https://wordpress.org/support/users/rogerush/)
 * (@rogerush)
 * [19 years, 11 months ago](https://wordpress.org/support/topic/renaming-sql-tables/#post-407896)
 * So I guess the problem was using a dash in the prefix, which I guess is not in
   SQL’s syntax. But after that I was able to change the prefix in `config.php` 
   and rename the old tables fine. It still asked me to run `install.php` again,
   but it went through smoothly and everything is working the way it should.
 * Thanks again for your help!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Renaming SQL Tables’ is closed to new replies.

## Tags

 * [prefix](https://wordpress.org/support/topic-tag/prefix/)
 * [rename](https://wordpress.org/support/topic-tag/rename/)
 * [renaming](https://wordpress.org/support/topic-tag/renaming/)
 * [sql](https://wordpress.org/support/topic-tag/sql/)
 * [table](https://wordpress.org/support/topic-tag/table/)
 * [tables](https://wordpress.org/support/topic-tag/tables/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [RogerUsh](https://wordpress.org/support/users/rogerush/)
 * Last activity: [19 years, 11 months ago](https://wordpress.org/support/topic/renaming-sql-tables/#post-407896)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
