Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Table prefix change: Old topics don’t display, New topics go to db table with old prefix

  • @expana

    Participant

    Hi guys,

    I feel the answer is very close, just don’t know which file to look in.
    Could anyone please assist with the below?

    My db prefix was wp_
    Using a security plugin I changed prefix wp_ to, say, mynewprefix_

    The result:

    1) DB side:

    I was not able to log in to the phpMyAdmin under the old db user name. (But I was able to log in to WordPress Admin pages)
    I created a new one db user and logged in successfully.

    In wp-config.php I still see

    /** MySQL database username */
    define(‘DB_USER’, ‘myolddbuserloginname’);
    /** MySQL database password */
    define(‘DB_PASSWORD’, ‘encryptedpasswordhere’);

    Should I change a db user here? (may be it causes what happens in “2)” below)
    If yes, how do I get an encrypted password?

    2) Web-site:

    Posts, Plugins, and Groups showed up after the prefix change, but
    Forums do not display. Neither forum topics nor forum tags.

    I created a topic. It saved, I see it in the web-site, but no old topics, they do not display.

    I used this link http://tdot-blog.com/wordpress/6-simple-steps-to-change-your-table-prefix-in-wordpress
    and manually went through steps. I found a couple of places with wp_ and changed them to mynewprefix.

    In the PhpMyAdmin I see that I have several tables duplicated. Eg:
    I see mynewprefix_bb_topics and wp_bb_topics.
    The first table contains all old topics, the second table has the only the topic I created after changing the prefix using the plugin.

    So it looks like all old topics exist, which is good.
    But WordPress or buddypress does not see the renamed tables. And it writes all new topics to tables that been (automatically? re-)created and named with an old prefix (wp_).

    What am I missing? Where?

    Thanks heaps for your help. I looked through everything I could think of…

    Natalie

    (I use wordpress Version 3.2.1, buddypress Version 1.2.9)

Viewing 7 replies - 1 through 7 (of 7 total)
  • @hnla

    Participant

    Firstly moral of this story is do not mess with Databases unless you really know what you are doing, plugins that suggest doing things to alter db conditions should have a lot of red warning text and detailed guidance on what the various options mean and will do.

    I’m tempted to suggest you should really roll back as I’m not sure how you have arrived at a mixture of tables within your db and that is not a good thing. In theory a change such as this is not rocket science and to be honest doesn’t require a plugin, manually changing the table prefix in something such as phpMyAdmin, knowing what other fields may also need changing and then changing the wp-config constant that sets the prefix should be all that’s required.

    You now, have in effect two DB in one (part of the reason one can add the prefix to tables) how you reconcile which you are using or how you merge those duplicate tables is going to be the issue, you may have to copy the new tables that now have data to the old ones so any new posts are preserved then delete the newer table and rename the old one with the new prefix.

    In this situation perhaps the first thing I would ensure is that I had a working DB and would create a new empty DB and restore a sql dump to it that way I could simply switch to that DB in wp-config and get back to original state in seconds.

    I would set up a db you can restore to I would also ensure that I wasn’t allowing further data to be created while I worked on a database.

    Some of the others may have further suggestions to help you along in the meantime do set up a new DB with a sql dump restored to it so you have a fallback while you try and sort things out, then at least you can get back to a working site easily and start over if necessary.

    One last thing this is probably more a topic suited to the main WP forums rather than BP support

    @expana

    Participant

    Hi Hugo! Thanks heaps for the answer!

    (I posted the question to WP forums, but then thought that may be it is something in Buddypress files that uses the old prefix. When I said “db prefix”, I meant “db table prefix”, sorry.)

    It was “WSD Security” (Wp database Security) plugin.
    I agree it’s not difficult to change prefixes when you know what to do :) Looks like the plugin worked, but something else is missing… somewhere..

    > you may have to copy the new tables that now have data to the old ones so any new posts are preserved then delete the newer table and rename the old one with the new prefix.

    Thanks for the advice. I have never done this before, I can try. Luckily I have not got any valuable topics, so I can easily ignore them. I.e. it’s ok if new topics created (that went to “wp_” table) will be lost.

    > In this situation perhaps the first thing I would ensure is that I had a working DB and would create a new empty DB and restore a sql dump to it that way I could simply switch to that DB in wp-config and get back to original state in seconds.

    I will try this.
    In wp-config I see db name and a user with an encrypted password.
    How can I get the password encrypted? I know it non-crypted as I enter it to phpMyAdmin.

    Thanks heaps again!
    Natalie

    @expana

    Participant

    I found an article about the password:
    http://www.tamba2.org.uk/wordpress/phpmyadmin/

    I’m wondering, what listed in wp-config – is it MD5 password?

    @djpaul

    Keymaster

    You may have updated wp-config.php, but group forums uses bb-config.php.

    @expana

    Participant

    Hi Paul! Milllion of hugs!!!!! It worked %)))
    Ah, such a relief…
    Thanks heaps!!!

    Thank you guys, you are very supportive. It is invaluable!
    Thanks heaps. Everything is ok now :)

    Cheers :)
    Natalie

    @hnla

    Participant

    always forget about bb-config :)

    You should in theory not be needing to worry about md5 or any other encryption passwords are plain text in wp-config/bb-config and in mysql they are hashed after entering.

    Anyways you sound as though you are sorted now, but infuture copying the database in phpMyadmin isn’t a bad idea attach an existing mysql user to it then all you need to is change wp-config db name to get back to a working db safely.

    @expana

    Participant

    Thanks for the advice, Hugo! :)
    Natalie

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Resolved] Table prefix change: Old topics don’t display, New topics go to db table with old prefix’ is closed to new replies.
Skip to toolbar