WordPress.org

Support

Support » Installation » [Resolved] Multiple WP blogs using same database.

[Resolved] Multiple WP blogs using same database.

  • I have a heavily modified version of WP that I am using for a movie blog website.

    What I want to do is create separate websites that use their own template, but use the same information and images from the main website.

    For example: I maintain the main website with 1,500+ pages of content.

    I then create a half dozen sites that use their own template and ads, but display information and images from the main site.

    Working in this way I can maintain one database to promote multiple companies.

    Any help would be appreciated. I have a separate site connected to the database already, that was easy. Images do not load though, and any link I click goes to the main website.

    Thanks!

    main website: http://www.zazzoid.com
    copy: http://tvdl.biz/

    Database works… But the path still points to zazzoid. 🙁

Viewing 15 replies - 1 through 15 (of 21 total)
  • I think that it will work if I hard code the SiteURL instead of loading it from the database.

    Working on figuring that out. Bruising my forehead on my desk in the process.

    OK…

    Now I think that it will mean I need a separate ABSPATH.

    Any advice would be awesome. I’ve managed to kill the site a few times now trying to do that. 🙂

    I manually changed “home” in the main database and that changed the links on both sites.

    Now I am looking for a way for each installation to use a unique variable for “home”, but still use the same content.

    As usual, any direction would be greatly appreciated. I am a persistent novice, nothing more.

    I need to figure out what script loads the “home” information from the database…

    Looks like I am having a conversation with myself. 🙁

    Anyhow, I found this post: http://www.heathersblog.com/2007/multiple-blogs-same-content/comment-page-1/#comment-19993

    It says to create a separate options entry in the database and to connect to that with separate installations. Unfortunately the code she demonstrates with no longer exists in current versions of WP.

    Anybody willing to help alter a current WP install to use shared content but a different options entry? I’ll keep plugging away, but I am by no means a programmer. I’m just stumbling along here.

    Any help would be appreciated.

    I think that I just need to get secondary versions of WP to access their own version of the ‘options’ database.

    I’ve made a copy of ‘wp_options’ and renamed it ‘wp_options2’ and then edited “zazzoid.com” to “tvdl.biz” in the database.

    On tvdl.biz I have tried to change every instance of ‘wp_options’ to ‘wp_options2’ but the links still go to “zazzoid.com”

    Arghhh!!!! WHY IS IT STILL LOADING THE OLD OPTIONS DATABASE!!?!?!?

    Mother expletiving expletive!

    FYI, I am now testing with version 2.8.6 instead of 2.9.2

    Where-O-where does WP load info from ‘wp_options’…? Certainly not anywhere I have changed it as yet.

    Hi Derek

    I am currently trying to do more or the less thing.

    I am working through your advice so if I come across anything at the end I will share. If you think of something before me then please let me know.

    Thanks

    David

    Hey David,

    Thanks for the reply.

    I keep hitting a wall when I change ‘options’ to ‘options2’ in public_html/tvdl/wp-includes/wp-db.php

    As I truly don’t know what I am doing, I am just changing ‘options’ every I find it.

    When I edit this line I am sent to a WP installation page.

    var $tables = array('users', 'usermeta', 'posts', 'categories',
    'post2cat', 'comments', 'links', 'link2cat', 'options2',
    'postmeta', 'terms', 'term_taxonomy', 'term_relationships');

    Hi Derek.

    I have two blogs now reading the same data from one database, my only issue now is having the second blog use its own domain for permalinks instead of the primary blog.

    I have site1.com and site2.com, if you go to site2.com the home page stays site2.com unfortunately when you click on a post etc it goes to site1.com/about.

    I think were nearly there.

    David

    Hey David,

    That sounds like where I have been stuck all day. Copying the config.php file from site1.com and pasting it into site2.com seems to do the trick with the data.

    Somehow we need to get site2.com to read an alternate version of the ‘wp_options’ database. In my case it is ‘wp_options2’.

    I’ve given up for the day. I’ve spent about 12 hours on this and need to clear my head.

    Please post if you manage to get that last step to work.

    Derek

    Hi Derek, I have accomplished what we set out to, Im just doing some final checks on it and making sure I have a universal admin for you. I will set up a step by step of what I done for you to have a look at if you like?

    David

    Awesome!!

    I’m staring at a database not knowing what I am looking for.

    I may have figured it out…

    I couldn’t connect to my second options database, so I decided to create a second ‘home’ database. I named it ‘2ndhome’.

    Now I am looking for ‘home’ in /public_html/tvdl/wp-includes/link-template.php and changing it to ‘2ndhome’

    Also had to make changes to /tvdl/wp-content/themes/ondemand/header-home.php and it seems to work perfectly!!!

    Im not quite sure I follow Derek.

    Are you talking about “get_option(‘home’)”?

    I never touched any of that as I wanted to be able to configure the blogs with different options from themes, settings, permalinks, plugins etc etc. I have made a few changes in 3 core files.

    For my sites I wanted to share the users across the sites as well which I have sorted. This doesn’t need to be configured if you want users to have to sign up for each site.

    I will post a full markup in the morning, I would email it over but its probably better on here in the hope someone else can benefit from it or advise on perhaps an even easier solution.

    Cheers
    David

    That would be awesome. I suspect there is an easier way than what I figured out.

    I also share users, the only thing that is not shared is the template.

    There is still an issue when I use “www” in front of site2, it does not load my gallery images. Without the “www”, the galley looks fine. That may not matter as I am reprogramming the gallery to work with an automated script that adds film data and images from imdb.com

    Looking forward to your “how to”. Has to be easier than mine.

    Hey David,

    Not sure if you will read this. Are you coming back to post how you accomplished this?

    It’s been a giant pain making one copy, and I want to make several more. Any help to shorten the process would be tremendous.

    Derek

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘[Resolved] Multiple WP blogs using same database.’ is closed to new replies.