Skip to:
Content
Pages
Categories
Search
Top
Bottom

Use tables in same database from other wordpress instance


  • guidobrasil
    Participant

    @guidobrasil

    Hi to you al,

    I would like to achieve the next thing. I have two instances of wordpress where I am sharing already the wp_user and wp_usermeta tables. That means that users are being shared on the two instances. On both instances I also have buddy press installed. Since I am using the same database I would also like to share the tables from one buddy press installation. I my opinion all communication of the buddypress installations should be the members, friends etc. etc. I guess you get the picture.

    I do understand that this is a case of changing the prefix from the table into the prefix from the instance I want to copy. I have been searching in the code of the buddy press plugin. It is though quite extended. Is there anyone who could help me out with that? Not to worry currently I am on two test instances and not my production environment.

    Just to go one step ahead it is not a multisite instance as the domain name are different so this is not an option for me.

    Hope you guys can help me out.

    Cheers,
    Guido

Viewing 2 replies - 1 through 2 (of 2 total)

  • ckchaudhary
    Participant

    @ckchaudhary

    This sounds doable theoretically. But i am sure there will be implications 🙂

    abc.com – table prefix wpabc_
    xyz.com – table prefix wpxyz_

    Now in xyz.com, if you want to use buddypress tables of abc.com, go to active theme of xyz.com > functions.php and add the following code: ( untested )

    add_filter( 'bp_core_get_table_prefix', 'bporg_244943_change_table_prefix', 99 );
    function bporg_244943_change_table_prefix( $prefix ) {
        return 'wpabc_';
    }

    guidobrasil
    Participant

    @guidobrasil

    Hi..

    Thanks for your reply. I am going to test this and will let you know how it works 😉

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Use tables in same database from other wordpress instance’ is closed to new replies.
Skip to toolbar