Support » Fixing WordPress » Renaming SQL Tables

  • Resolved RogerUsh


    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!


Viewing 3 replies - 1 through 3 (of 3 total)
  • 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.

    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

    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”.

    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.