WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to install multiple WP instances to one DB (21 posts)

  1. monk@loosemonkey.net
    Member
    Posted 1 year ago #

    Can anyone please point me to specific step by step instructions of how to install muliple instances of WP pointed to one DB? I already have one WP blog installed on my server. I would like to create 2 more blogs. I would prefer to install seperate instances of WP as the network feature does not sound like what I need.

    I am the only accessing the ADMIN dashboard for these blogs and the server is hosted directly by me... meaning I have hands on access to it.

    Thanks for any help here.

  2. michael.mariart
    Member
    Posted 1 year ago #

    All you need to do is edit the wp-confing.php file and make sure atht the value for:

    $table_prefix = 'wp_';

    is different for each installation. You can make wp_ anything that you want, just make it unique for each site. Then, you can proceed with the standard installation process.

  3. monk@loosemonkey.net
    Member
    Posted 1 year ago #

    I have seen instructions that say just that. However, there obviously is something missing as I have done just what you say.

    Here is what I have done
    1. Downloaded and unzipped the latest WordPress to my harddrive
    2. Here is where there is a HUGE gap in the process. I have copied the existing wp-config.php and edited it so that $table_prefix = 'wp_'; does indeed have a different prefix. The prefix I edited to is wpna_
    3. I left everything else in the wp-config.php the same. Copied the file back to the newly unzipped files in the correct folder.
    4. Called the wp-admin/install.php file from the browser. However, get the following error:

    Error establishing a database connection
    This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at XXXXXX. This could mean your host's database server is down. "XXXXX" being the current database name.

    5. I have tried different Database Names in the wp-config.php file but continually get the same error.

    What Database name is it looking for then if I am trying to use the same DB?

    This is obviously not as simple as merely changing the $table_prefix

  4. michael.mariart
    Member
    Posted 1 year ago #

    This means that your database details are not correct. I'd say that this means that you haven't copied the wp-config.php file to where you think that you have. Double-check the file in the folder that it's supposed to be in and see what it says. Remember, not your local file, but the file that's actually on your web server.

  5. monk@loosemonkey.net
    Member
    Posted 1 year ago #

    The wp-config.php should be in the same folder as wp-confg-sample.php, correct? It is...

  6. michael.mariart
    Member
    Posted 1 year ago #

    Yes it should be, and if you're getting that error then it is in the right place. if the file wasn't there you'd be getting a different error. What I said was that you need to check what is actually in the wp-config.php file. If it's on the same server but just in a different directory and they both have the exact same database details there's no reason why it shouldn't work and you'd have to contact your hosting company to ask them why because we can't diagnose isues like that.

  7. monk@loosemonkey.net
    Member
    Posted 1 year ago #

    As I stated at the beginning of this post:

    I am the only one accessing the ADMIN dashboard for these blogs and the server is hosted directly by me... meaning I have hands on access to it.

    I am the host of my server.

    So again, what is not clear here are what the exact steps are to use the same DB for another blog on the same server.

    If I copy the wp-config.php from the blog that is already running on my server and simply edit the $table_prefix to something unique, and copy to the the correct folder of the new blog, is that all that is sufficent. As that is what all the instruction say is only needed. My guess is that is not correct.

    My guess is no which is why I am asking anyone if they can point me to step by step instructions of how to do this.

  8. michael.mariart
    Member
    Posted 1 year ago #

    What you have raed. That is the only step that's needed. I've done this a few times now, so I know that is how it's done. If you can't connect to your database, then the database connection details that you have in the wp-config.php file are wrong - it has nothing to do with the setting for the database prefix.

  9. monk@loosemonkey.net
    Member
    Posted 1 year ago #

    So, as I have stated, I copied the wp-config.php file from the existing working blog and edited the $table_prefix from wp_ to wpna_. Saved the file and copied back to the same folder in the new blog folder.

    If the DB connection settings are wrong, how is the existing blog functioning?

  10. michael.mariart
    Member
    Posted 1 year ago #

    I don't know. You're the one that's adminsitering your systems, and I can't see how they are set up. All I can tell you is what I have so far. Changing the prefix will not affect the database connection. If you can't connect to the database, the database connection deatils are wrong. I don't know why or how becaue I can't see how your system is set up. As it's your server, I'm sure that you can check out the error logs that are available from PHP, Apache and MySQL and get more information on this then we can. :)

  11. monk@loosemonkey.net
    Member
    Posted 1 year ago #

    I am the one administering my system. I already have a successful blog configured and running on my systems.

    Let me try this differently.

    Should I be able to copy the exising wp-config.php file from the existing blog folder, edit the $table_prefix as I have described, and copy it to the correct location of the new blog folder?

    And I am not using Apache, it's a Windows based server.

  12. michael.mariart
    Member
    Posted 1 year ago #

    Yes you should. That is all that you should need to unless something else is wrong.

  13. monk@loosemonkey.net
    Member
    Posted 1 year ago #

    that sure doesn't work.

  14. michael.mariart
    Member
    Posted 1 year ago #

    Sorry, but it's worked for me a few times and it's worked for a lot of other people. I can't give you any more advice because what I've told you so far is what the problem normally is.

    My only suggestion now is to copy the wp-config.php file without making any changes. If you do that and it works, then you'll know that what ever I've said is wrong and you can then change the prefix and do the standard installation. If you do that and it doesn't work, then you'll know that it's not an issue with the prefix and you'll have to look at the way that your server is running rather then what you are doing with WordPress.

  15. monk@loosemonkey.net
    Member
    Posted 1 year ago #

    I tried your suggestion and now when I open wp-admin/install.php in a browser I get the following:

    Already Installed
    You appear to have already installed WordPress. To reinstall please clear your old database tables first.

    This would indicate to me that there is no issue with the database connection details as I would suspect. The only change to the file that I have been making is the $table_prefix as I have stated and as the instructions have stated to do.

  16. michael.mariart
    Member
    Posted 1 year ago #

    OK, so now go and change the prefix in the file that you've got. If that's the only change that you make then there should be no problem.

  17. monk@loosemonkey.net
    Member
    Posted 1 year ago #

    That is exactly what I have done already which does not work.

  18. michael.mariart
    Member
    Posted 1 year ago #

    Then I can't help you any more. The only thing that needs to be done in a normal system is change the prefix value.

  19. monk@loosemonkey.net
    Member
    Posted 1 year ago #

    This is a "normal" system. With an already functioning blog, http://blog.jollyrogersmotorcycleclub.com and a number of other fully functional websites.

    Does the web service need to be configured for the particular new blog site prior to the successful installation of a new blog?

  20. monk@loosemonkey.net
    Member
    Posted 1 year ago #

    Alright! Finally got it. As I suspected there were more steps then stated in the vague instructions.

    1. The blog website needs to be configured first in the server webservice, IIS in my case.
    2. The $table_prefix is NOT the only line that needs to be edited in the copied wp-config.php from the existing blog already live on the server. The define('DB_HOST', also needs to be changed to the URL of the new blog site. Once this was done the wp-admin/install.php page immediatly came up in the browser when called via http:// and allowed me to install the new blog in seconds.

    ...

  21. tonymuffin
    Member
    Posted 1 year ago #

    Wow! That's great monk!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.