The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

2 Blogs on 1 MSQL Database? (13 posts)

  1. mrbrut
    Posted 11 years ago #

    Hello All ,
    I have tried a search and not had too much luck as I am already confused.
    What I would like to do is have 2 WordPress blogs on my webspace. One will be the one everyone sees and uses and the other will be for testing templates and other things.
    If I have both blogs reading the same MYSQL database will this mess things up? Or should I just have two databases...?
    Many Thanks!

  2. Mark (podz)
    Support Maven
    Posted 11 years ago #

    That's no problem at all.
    All you need to alter is the 'table_prefix' in wp-config.php when you install the second blog.
    The first blog will have a prefix of 'wp_' so just make the second have a prefix of 'wp2_' and all will be good :)

  3. mrbrut
    Posted 11 years ago #

    So by making the prefix of the second blog 'wp2_' the second blog will be able to read all of the entries and comments from the first?
    Also if this is the way to do what I am trying to do... where do I change the prefix?
    Many Thanks

  4. Mark (podz)
    Support Maven
    Posted 11 years ago #

    The two blogs will be entirely seperate - did you need them to share data ?
    Open wp-config.php - the option to alter the table_prefix is in there.

  5. mrbrut
    Posted 11 years ago #

    Sharing data would be handy as this way I'd be able to see what the blog will 'look' like etc. I won't be adding any posts or comments in the 2nd test blog just change the design , templates and plugins etc.

  6. If you're testing templates, may I suggest just renaming the different index.php and wp-layout.css files you're testing?
    Example: Your current known-good layout uses index.php/wp-layout.css
    You're tweaking another layout with index2.php/wp-layout2.css
    In index2.php, you'd make sure you're calling for wp-layout2.css (rather than the default wp-layout.css).

    That way, you get the best of both worlds and you don't need to undertake two WP installs - even though it is small. :)

  7. mrbrut
    Posted 11 years ago #

    Great Idea!
    Thank you very very much. I'll do that.
    Many Thanks again, you're all great help!

  8. Nice, glad we were able to help. You will link to your blog in your member profile, so we can see how you're doing...riiiight? ;)

  9. sfong15
    Posted 10 years ago #

    Hi Podz, I guess I could use the same trick to migrate from one domain name to another, both under same hosting/server?

    Let's say, I have blog1 going fine, then install a new blog2, change wp-config.php such that blog2 with new domain name connects to the same database of blog1. Later delete installation blog1 under old domain name.

    Alright doing that?

  10. Mark (podz)
    Support Maven
    Posted 10 years ago #

    sfong15 - you cannot have two active blogs sharing the same database. Because they cannot share precisely the same name / url, things will certainly break.

    But..... if there is no sharing like that, it should be okay.. (I've not yet had a coffee though so do post again if what I've said doesn't help.)

  11. dommega8
    Posted 10 years ago #


    two+ active blogs and the same database

    I am currently using 95 with this setup and no breakage.

  12. Alex Mills (Viper007Bond)
    Posted 10 years ago #

  13. sfong15
    Posted 10 years ago #

    Yes, Podz, it broke my test blog because wp-blog-header couldn't resolve 2 different url.

    Any better way to do migration from one domain name to another under same hosting?

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.