WordPress.org

Ready to get started?Download WordPress

Forums

single database, multiple domains (24 posts)

  1. drbeamer
    Member
    Posted 4 years ago #

    I did a lot of research here and on Google, but the only thing I found is that MU might actually not work for this:

    - I have two domains (site1.com, site2.com) and each has its own WP installation with its own custom theme.

    - I want to use one single database, to which I add content using the wp-admin panel. User comments are deactivated; the db only holds my posts.

    - I have configured WP through the admin panel to use site1.com as the wp site location and blog location. The content shows correctly on site1.com

    - On site2.com, however, I get a database connection error. Wp-config.php on site2.com holds the same connection strings as wp-config.php on site1.com as I want to use the same db.

    What am I doing wrong? Do I need to add site2.com in wp-admin panel as a second valid blog location? If so, how do I do that?

    TIA,
    John

  2. maierma
    Member
    Posted 4 years ago #

    You can easily run numerous WP-installations in one database. The only thing you need to be aware of is that each wp-installation needs a unique prefix set in wp-config.php, i.e. wp1_, wp2_ or anything you like.

  3. maierma
    Member
    Posted 4 years ago #

    // You can have multiple installations in one database if you give each a unique prefix
    $table_prefix  = 'wp_';   // Only numbers, letters, and underscores please!
  4. Do I need to add site2.com in wp-admin panel as a second valid blog location? If so, how do I do that?

    Yes, if you;re using the network. It won;t "find" exisiting separate installs on the same server, that's not how it works.

    Also, in case you're looking to do this - you will still need to visit the backend of each one to post to each blog. They are siloed content.

  5. drbeamer
    Member
    Posted 4 years ago #

    @ maierma: thanks, but this does not work. I changed "wp_" to "wp2_" in wp-config.php on site2.com, and I am getting the same database connection error.

    are you sure this is the only change to be made on site2.com?

  6. drbeamer
    Member
    Posted 4 years ago #

    @ andrea_r: how do I add site2.com in the wp-admin panel? I only see one input field for "blog location".

    Also, what do you mean by "you need to visit the backend of each one to post to each blog"? There is only one blog. Site2.com simply displays the content entered in the wp-admin panel for the original site1.com.

  7. Go to Super Admin -> Sites. Add it there, where it says "add a site".

  8. drbeamer
    Member
    Posted 3 years ago #

    thx andrea - so you are saying I need to install WPMU to mirror my blog's entries on a second site? my research in the wp forums found that wpmu does not work for what i want: simply showing blog entries from site1 also on site2 using a custom site2 theme. please confirm.

    tia

  9. So you have a second domain with a complete separate installation of WP?

  10. drbeamer
    Member
    Posted 3 years ago #

    I have a second website on which i want to simply display all posts from blog#1 which is hosted on website#1.

  11. drbeamer
    Member
    Posted 3 years ago #

    Do I need a completely new installation of WP on website#2 ?

  12. Well, no. you're posting in the multisite section which deals with the new multisite feature which lets you have more than one site (blog) in one install. complete with multiple domains.

  13. JohnL
    Member
    Posted 3 years ago #

    Folks, I hope to follow this, as it looks like it will be helpful for me with a related situation. Just letting you know others are listening!

  14. @john - the multisite feature now built in to 3.0 will handle multiple blogs in one database. here's how to enable it:
    http://codex.wordpress.org/Create_A_Network

    A plugin will handle full domains for each site.
    http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/

  15. JohnL
    Member
    Posted 3 years ago #

    Andrea_r, if this is off-point for this thread, I'll move it.

    I'm preparing to migrate to WP 3 and have it host at least eight blogs that now stand alone in separate directories, each with its own domain name. I'm studying and (apprehensively) studying some more. In addition to the welcome to the multisite forum, I've read two codex sections regarding installation: (a) /Create_A_Network (b) Migrating_Multiple_Blogs_into_WordPress_3.0_Multisite. (The latter exclusively discusses sub-domains, which ain't for me.) I've also perused entries on wpmututorials.com.

    More about the situation:

    ==> Five installations share a database, and their tables are differentiated within it by the first 2-3 characters (e.g., mno_links, qrs_links, xyz_links).

    ==> Three installations have their own databases (in the same mysql instance).

    ==> Currently the blogs each live in separate subdirectories, once removed from the root directory: /holdingplace/blog1/wp-files, /holdingplace/blog2/wp-files, etc.

    ==> I manage the situation at the command line under BSD unix. I have root for the server.

    ==> I do back up!

  16. In addition to the welcome to the multisite forum, I've read two codex sections regarding installation: (a) /Create_A_Network (b) Migrating_Multiple_Blogs_into_WordPress_3.0_Multisite. (The latter exclusively discusses sub-domains, which ain't for me.)

    You have to pick a format to start, then you use this plugin to map the full domain name:
    http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/

    More about the situation:

    ==> Five installations share a database, and their tables are differentiated within it by the first 2-3 characters (e.g., mno_links, qrs_links, xyz_links).

    ==> Three installations have their own databases (in the same mysql instance).

    ==> Currently the blogs each live in separate subdirectories, once removed from the root directory: /holdingplace/blog1/wp-files, /holdingplace/blog2/wp-files, etc.

    those'll be changing. ;)

    You'll be needing to do this 5 times:
    http://bavatuesdays.com/importing-a-single-wp-blog-to-a-wpmu-installation/

    Once for each exisiting install.

    So, in short, you'll be picking one install to be the main (preferably in the root) and the rest will be torn down and rolled within.

  17. dalicen
    Member
    Posted 3 years ago #

    I'm late to this conversation, which I got to by a search. I want to use WP on a 2nd subdomain, having run WP on one for several years. When it comes time to edit the wp_config.php file, I read

    // You can have multiple installations in one database if you give each a unique prefix
    $table_prefix = 'wp_'; // Only numbers, letters, and underscores please!

    But WHERE does the prefix go? Prefix to what? Am I to change the name to wp_newprefix_config.php? DO I need to have two wp_config files uploaded to my root directory? Or is there some place within the existing wp_config.php file where I need to change and/or add a new line?

    Please assume I'm stupid and spell it out. Getting the PhD used up a lot of brain cells.

    Thanks bunches.

  18. Do you want two separate installs stored in one database?

    Or do you want to use the multisite feature?

    there are TWO different paths here. :) Up to you to pick one. then I can give the step by step.

  19. dalicen
    Member
    Posted 3 years ago #

    At this point I'm not expecting to have more than one additional WP site, so I'm guessing it may be easier, or at least less complicated, (?) if I were to do a 2nd install in the one database. (But if the multisite feature would be simpler, then I'll be happy to do that.) Thanks!

  20. If you;re only going to do a second install in the same database, you need to set up a second folder with all the wordpress files in it.

    Then when you go to do the regualr install, just fill in a different db table prefix. instead of wp_, pick wp2_ for example. then install as usual.

  21. lashedup17
    Member
    Posted 3 years ago #

    Andrea_r thanks for the help so far.

    So let me ask a clarifying question I think is related.

    I want to be able to make a single post and be able to choose which websites (running WordPress) that post will appear on across multiple domains.

    So for instance we have a main car-related website that covers all the car news for multiple car brands. I also have a number of individual websites on their own domains that cover specific brands of cars. So if I need to run a press release about a Volkswagen I would like it to appear on the main site and also on our Volkswagen-specific website (on a separate domain) using just one main control panel.

    Is that possible through some combination of either WordPress on a single database or WordPress Multisite and/or plug-ins?

    Thanks in advance for all the help!

    -j

  22. dalicen
    Member
    Posted 3 years ago #

    f you;re only going to do a second install in the same database, you need to set up a second folder with all the wordpress files in it.

    Then when you go to do the regualr install, just fill in a different db table prefix. instead of wp_, pick wp2_ for example. then install as usual.

    Andrea, thanks for the response. Between the time I posted my original question and now I had a medical emergency and am still on some thought-impeding drugs, so I'm more fuzzy-brained than usual. I need to be a pain in the neck and ask you to be more specific.

    When you say I need to set up a second folder with the wordpress files in it, do I need to give a particular name to it, or to any of the files in it? Am I uploading the entire folder during installation, or only files in the folder? As for designating a new db table prefix, is that something I'll be prompted to do during installation? I'm lost here.

    FYI, I'm transferring files by a stand-alone FTP client. Using cpanel and MySQL Databases, I have only one active database--the current wordpress db, designated wrdp1. Am I going to install wordpress again alongside the original, or does the second installation happen within the original?

    Sorry to be a pain, but I'm losing track of what I'm supposed to do, shifting from this page to the install page to cpanel to ftp and the different directories among them. I would appreciate as much of a step-by-step instruction list as you can do.

    Thanks tons--

    Deb

  23. When you say I need to set up a second folder with the wordpress files in it, do I need to give a particular name to it, or to any of the files in it?

    Nope, whatever you like.

    Am I uploading the entire folder during installation, or only files in the folder?

    Everything under the /wordpress/ folder on your desktop, put in the new folder you just made.

    As for designating a new db table prefix, is that something I'll be prompted to do during installation?

    nope, no prompts. Just when you fill out the wp-config files, use the same database username and password. there's alreayd a line in there regarding the db prefix. For simplicity''s sake, make it wp2_.

    then continue as usual.

    this will give you two separate installs of wordpress, but the data from both is in one database. wordpress will sort it out.

    I have been on the fuzzy-brain pain meds and had to code. :) It's no fun, so start when rested and about 30 mins after the meds kick in.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.