• Hey everyone,

    Site A is on hosting1 and domain1 and a fully implemented \ set up wordpress website.

    Site B is on hosting2 and domain2 and a new WP installation\instance.

    Is there any way to sync the users data from Site A to Site B so that any users of Site A can login to Site B?

    I can’t find a solution….

    Thanks in advance

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter ltd2009

    (@ltd2009)

    I understand that this might be possible to do in the wp-config file..

    However, how would you point this to a remote server\db?

    define(CUSTOM_USER_TABLE,’wp_users’); define(CUSTOM_USER_META_TABLE,’wp_usermeta’);

    Hey ltd2009,

    That’s a great question, hopefully, someone comes up with a better idea, cause I only found what you found as far as

    define(CUSTOM_USER_TABLE,’wp_users’);
    define(CUSTOM_USER_META_TABLE,’wp_usermeta’);

    and I don’t believe you can make those remote by themselves, you could always make site B connect remotely to the same database as site A under a different prefix (SiteA would connect to db as localhost, SiteB would connect to the host of site A, same user and password, different prefix) , and then I think you could use those defines so they use the same table for users and usermeta tables.

    Inside SiteB wpconfig, things that would need to be changed:
    define( ‘DB_NAME’, ‘siteA’s Db’ );

    /** MySQL database username */
    define( ‘DB_USER’, ‘SiteA’s User for DB’ );

    /** MySQL database password */
    define( ‘DB_PASSWORD’, ‘SiteA’s Password for DB’ );

    /** MySQL hostname */
    define( ‘DB_HOST’, ‘SiteA’s hostname’ );

    define( ‘CUSTOM_USER_TABLE’, ‘SiteA’s table for users’ );
    define( ‘CUSTOM_USER_META_TABLE’, ‘SiteA’s table for usermeta’ );

    $table_prefix = ‘anything that is not what SiteA is using’;

    Although that sounds like it might slow Site B down since it has to communicate with Site A hosting for the database.

    this site goes over the basic idea of everything except how to connect to a remote DB for siteB, but everything else would stay the same.
    https://trickspanda.com/wordpress-share-users-login/
    But I think that would work,
    I am not sure, I might try to do a test and see later, hopefully, someone has another solution.

    • This reply was modified 8 years, 3 months ago by jamisonb.
    • This reply was modified 8 years, 3 months ago by jamisonb.
    Thread Starter ltd2009

    (@ltd2009)

    Thank you! I will give this a read and try. I really appreciate you taking the time to look at this.

    No Problem! I hope it works, I can’t think of a reason it wouldn’t, but there is a lot I don’t know. I have never done what you are trying to do, but I have done most the steps separately (connected a remote DB in one instance, change tables in another, just never to the same instance).
    So I am still hoping someone with more experience answers this questions cause I also want to know now.
    I tried to test on my end, but I only have a few resources (1 remote server, I turned my desktop into a LAMP stack to try and replicate with my remote server, but my remote AWS server was a package install for convenience, and it doesn’t allow remote DB connections even after I changed my.cnf bind address to 0.0.0.0, so something is blocking me, but since it was pre-configured I am not sure what yet, but the problem I am having is an environment error, nothing that is being blocked by WordPress software, so I am still hopeful this is a working solution for you.)

    If you run into an issue, let me know and I will try to troubleshoot it with you.

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

The topic ‘Sync User table across multiple sites’ is closed to new replies.