Forums

Database Confusion - WP seems to be in 2 DBs, how to fix/merge? (7 posts)

  1. saldridge
    Member
    Posted 3 years ago #

    Hello all,

    I am running WP on my own server, and I have to admit that I am quite inexperienced when it comes to databases. I installed the WordPress through my host with what they call "clickStart"-applications and I had a few problems with it. I don't really remember anymore what it was but I had to go through a couple of install/uninstall processes.
    My webspace provides me with 2 databases, lets call them DB1 and 2 (doh, sorry). I thought it would be nice to install a second unrelated WP into the second database.
    On my web space, my host claims that WordPress is installed in DB1.

    Now, I looked at the two DBs through phpMyAdmin, and I see the following:

    DB1:
    wp_comments
    wp_links
    wp_options
    wp_postmeta
    wp_posts
    wp_terms
    wp_term_relationships
    wp_term_taxonomy
    wp_usermeta
    wp_users

    DB2:
    wp_comments
    wp_links
    wp_options
    wp_postmeta
    wp_posts
    wp_statpress
    wp_TABLE_STATISTICS
    wp_TABLE_STATISTICS_RAW
    wp_terms
    wp_term_relationships
    wp_term_taxonomy
    wp_usermeta
    wp_users

    I clicked on wp_posts and for DB1, I see that the Last Update is the same date as Creation - I am pretty sure that means that this is NOT the one I am actively using, even though my host says it is.
    Looking at the same in DB2, it shows the date I actually posted last.

    I am pretty sure if I install another instance for WP, I am messing this up. Now, what can I do? How can I fix this? I guess since my host says I am on DB1, I should take the DB2 content and move it to DB1? Or should I better backup DB2, delete everything in both databases, start from scratch and import my content back in?

    Please advise
    Susanne

  2. MichaelH
    Volunteer
    Posted 3 years ago #

    You wp-config.php file describes what database is being used.

    Before doing anything backup BOTH databases.

    Then if you need to merge databases, I'd change your wp-config.php to point to the database you will NOT use routinely, then login to the admin section and do Tools->Export, save the resulting file, then logout.

    Then fix the wp-config.php to point to the other database, the one that will be your routine databse, then login to admin and do Toools->Import->WordPress with the file you created above.

  3. saldridge
    Member
    Posted 3 years ago #

    OK, I just tried that, and if I point wp-config.php to DB1 and I try to open the site, it is just a blank page, nothing there (View Source is blank too). Theoretically I could just delete everything from DB1 then, it seems like it is just the table structure?
    But then, how do I fix the control panel of my host because there it says I have WordPress running on DB1?

    Theoretically, there are two ways to fix it:
    a- change the host to realize that WP is running on DB2
    b- actually move all my WP stuff to DB1

    I don't know how to do either of those. a is a problem because I just have a cheap host and I am not sure I get much out of their service. For b I have high hopes that someone can tell me how to move my stuff. Could I just go into the phpMyAdmin, export the whole she-bang from DB2, then import it into DB1?

  4. MichaelH
    Volunteer
    Posted 3 years ago #

    If your blog is running fine, and you don't have any missing posts, then maybe do NOTHING.

  5. saldridge
    Member
    Posted 3 years ago #

    Well, the problem is that I want to install a second WP and I only have those two databases. Wouldn't one overwrite the other?

  6. MichaelH
    Volunteer
    Posted 2 years ago #

    See Installing Multiple Blogs and discussion about using different $table_prefixes.

  7. saldridge
    Member
    Posted 2 years ago #

    Thanks, I will look into this - even though I'd rather clean up the mess I have inadvertently created.

    BTW, what I described above didn't work. I tried to export DB2 which worked fine but I always got errors when I tried to import it back into DB1.

Topic Closed

This topic has been closed to new replies.

About this Topic