Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. WordPress (Developer)
  3. Multiple WP sites sharing wp_users db table

Multiple WP sites sharing wp_users db table

Scheduled Pinned Locked Moved Unsolved WordPress (Developer)
10 Posts 6 Posters 1.5k Views 6 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C Offline
      C Offline
      ChicagoGregg
      wrote on last edited by
      #1

      Hello,

      I am looking into the feasibility of running two WP (developer) instances within Cloudron.

      I would like to share the WP users between the two.

      I don't think this is possible by default since each MySQL db is separate per WP app instance.

      Has anyone done this before? Is it possible to do?

      I would think it could be possible by GRANT'ing the WP DB user (defined in wp-config.php) with the host/IP ??? e.g. adding the @172..... IP to the user so that it can access the db table.

      Thoughts?

      Thanks!

      -gregg

      P girishG 2 Replies Last reply
      1
      • RazielKanosR Offline
        RazielKanosR Offline
        RazielKanos
        wrote on last edited by
        #2

        Take a look at this:
        https://wordpress.org/plugins/wp-remote-users-sync/

        C 1 Reply Last reply
        1
        • nebulonN Offline
          nebulonN Offline
          nebulon
          Staff
          wrote on last edited by
          #3

          Have you considered installing both app instances with the Cloudron user management option enabled?

          C 1 Reply Last reply
          2
          • nebulonN nebulon marked this topic as a question on
          • RazielKanosR RazielKanos

            Take a look at this:
            https://wordpress.org/plugins/wp-remote-users-sync/

            C Offline
            C Offline
            ChicagoGregg
            wrote on last edited by
            #4

            @RazielKanos

            Yea, I saw that. I configured that about a month ago between two sites (non-cloudron) in separate locations.

            That involves enabling the App Passwords, manually creating the roles, and some other nuances.

            For a "local" instance -- e.g. both WP instances are within the same cloudron -- while this option is viable, making remote API calls, IMO, might be a little overboard.

            I've considered this as a last option if I need to.

            Thanks for the reply!

            1 Reply Last reply
            0
            • nebulonN nebulon

              Have you considered installing both app instances with the Cloudron user management option enabled?

              C Offline
              C Offline
              ChicagoGregg
              wrote on last edited by
              #5

              @nebulon Using the WP LDAP plugin to query Cloudron? Yea, but that would mean I need to host the users in Cloudron; and I lose a lot of WP functionality. Not a solution, IMO. 😞

              Thanks for the reply.

              1 Reply Last reply
              0
              • C ChicagoGregg

                Hello,

                I am looking into the feasibility of running two WP (developer) instances within Cloudron.

                I would like to share the WP users between the two.

                I don't think this is possible by default since each MySQL db is separate per WP app instance.

                Has anyone done this before? Is it possible to do?

                I would think it could be possible by GRANT'ing the WP DB user (defined in wp-config.php) with the host/IP ??? e.g. adding the @172..... IP to the user so that it can access the db table.

                Thoughts?

                Thanks!

                -gregg

                P Offline
                P Offline
                plusone-nick
                wrote on last edited by plusone-nick
                #6

                @ChicagoGregg I’m curious now too lol
                Try it out! You’d need the host IP like you mentioned and also the username / DB name of the specific WP instance that would be the “DB host” In theory…

                From what I understand cloudron makes a new table and user are made per app all within one SQL instance (service) so I’d imagine It could work

                Note: if you’re only trying to use the user table and then use different/related tables for each apps main use cae you might run into a WP/logic/DB issue - just an assumption

                ✌💙+1

                1 Reply Last reply
                0
                • C ChicagoGregg

                  Hello,

                  I am looking into the feasibility of running two WP (developer) instances within Cloudron.

                  I would like to share the WP users between the two.

                  I don't think this is possible by default since each MySQL db is separate per WP app instance.

                  Has anyone done this before? Is it possible to do?

                  I would think it could be possible by GRANT'ing the WP DB user (defined in wp-config.php) with the host/IP ??? e.g. adding the @172..... IP to the user so that it can access the db table.

                  Thoughts?

                  Thanks!

                  -gregg

                  girishG Offline
                  girishG Offline
                  girish
                  Staff
                  wrote on last edited by
                  #7

                  @ChicagoGregg said in Multiple WP sites sharing wp_users db table:

                  I would like to share the WP users between the two.

                  Is this something supported by WP ? How can it share users but not anything else? It writes to db1 for users and db2 for other things like posts/comments ?

                  C 1 Reply Last reply
                  1
                  • girishG girish

                    @ChicagoGregg said in Multiple WP sites sharing wp_users db table:

                    I would like to share the WP users between the two.

                    Is this something supported by WP ? How can it share users but not anything else? It writes to db1 for users and db2 for other things like posts/comments ?

                    C Offline
                    C Offline
                    ChicagoGregg
                    wrote on last edited by ChicagoGregg
                    #8

                    @girish said in Multiple WP sites sharing wp_users db table:

                    @ChicagoGregg said in Multiple WP sites sharing wp_users db table:

                    I would like to share the WP users between the two.

                    Is this something supported by WP ? How can it share users but not anything else? It writes to db1 for users and db2 for other things like posts/comments ?

                    Sure, this is done currently on WP sites even when cloudron isn't in the mix. For simplicity of this thread, I was just referring it to wp_users, but it also requires usermeta.

                    I wonder how the bigger sites using WP also have their topology laid out with MySQL DB's clustered, and even with something like Kubernetes.

                    I would love to find a tech paper somewhere on this. And then, when it comes to having a larger website that is load balanced across disparate physical locations, how Cloudron could (if possible) be laid out to handle the workload. I'm thinking that it would be difficult and, in these situations, it might be best to simply have a dedicated host running, for example, Docker, Portainer, Kubernetes, MySQL (clustered), etc.

                    ==========

                    Ok, it might be that I'm the guinea pig for this to test to and validate this works as expected.

                    I've found the below two articles to be very valuable.

                    1. How to Share Logins and Users Between Multiple WordPress Sites - https://kinsta.com/blog/share-logins-wordpress/

                    2. The Ultimate Guide to WordPress User Roles and Capabilities - https://kinsta.com/blog/wordpress-user-roles/

                    After reading the above two, I think the WP sites would have to use the same MySQL database, but have a different DB table prefix for each site (for the non-wp_users and wp_usermeta tables). The WP hook that the first article references is essentially to clone the user capabilities from one site to another within the same MySQL database upon modification.

                    Basically, here is what I'm working on.

                    Site #1 - Primary website (domain.org) that hosts the home page / landing page. Introduces the visitor to the society, its features, how the public/private memberships work, how to join, etc. This also will likely handle some administrative-related functions (including plugins), e.g. CRM, Support/Ticketing system, newsletter blasts, etc. This might also be the primary interface for where user roles, metadata, etc. are administered (TBD).

                    Site #2 - Social website part of the society (domain.social). This runs the social platform, event calendar, etc. It will also have such WP plugins like AutomatorWP and WP Fusion (amongst others).

                    Site #3 (TBD) - Media platform (domain.tv). This will handle a "media" related matters... Very similar to such sites like YouTube, Rumble, Bitchute, Odyssey, etc. and/or providing a "Netflix-like" type site. Users, based on their membership level, would be able to access this site. The users would likely also be "synchronized" to this site.

                    For now, I will be working on checking into the feasibility and implications for Site #1 and Site #2 "synchronization".

                    I will find out also what drawbacks, if any, exist for such things like having AutomatorWP (Site #2) trigger certain events and if it would (could) be picked up by the CRM (Site #1).

                    I would love to keep the administrative-related functions separate from Site #2 and Site #3. No need to have additional bloat where not needed.

                    So, within the next month, I plan on getting all this in place. I will do some testing and validation in the next few weeks.

                    If anyone has information, tips, etc. please do chime in!

                    Looking forward to checking this out. 🙂

                    -gregg

                    1 Reply Last reply
                    2
                    • C Offline
                      C Offline
                      corsacca
                      wrote on last edited by
                      #9

                      Could this be accomplished with the WordPress multisite functionality? It is one WordPress instance that shares the wp_users table. Each subsite can set up with a different domain.

                      girishG 1 Reply Last reply
                      1
                      • C corsacca

                        Could this be accomplished with the WordPress multisite functionality? It is one WordPress instance that shares the wp_users table. Each subsite can set up with a different domain.

                        girishG Offline
                        girishG Offline
                        girish
                        Staff
                        wrote on last edited by
                        #10

                        @corsacca yes, multisite can do this. The original question wanted to install 2 separate apps and share the db table. This is not possible.

                        1 Reply Last reply
                        1
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Bookmarks
                          • Search