Joomla

One set of Joomla users, multiple Joomla installs

Every once in a while there will come a time in your Joomla career that will necessitate the need to have two or more Joomla sites for one project. You don’t want to force your users to sign up for two sites–it’s annoying. You want them to sign up once, and be able to login to both the Joomla sites.

There’s an app extension for that

Extensions exist that tackle this problem. jFusion is the biggest player in this arena, and really shines when you need to merge users from Joomla to other CMS’s or scripts such as vBulletin, XenForo, Magento and others. It has it’s flaws though, and after using it for a while I started searching for a different option. After searching for a few weeks I came across this post on Joomla.org. After messing around with many different “extension based” solutions I was excited to try a more backend approach to the problem. Extensions are fine to a point, but jamming your site full of every plugin/component/module that you see on Joomla.org is only going to give you more trouble than it’s worth. Digging into how things work will give you a better understanding of how your site operates and how to keep things lean. In this case, the solution is not all that complicated either.

jfusion or editing jos_tables manually?

Random Indeed.

Warning, Warning Will Robinson!!

This is considered an advanced project that should only be tackled by somebody who is familiar with phpmyadmin, (or some sort of sql tool), how to run sql queries, and is very comfortable with Joomla and it’s inner workings. This should only be attempted on a development site, not on your live site, unless you have a sure fire recovery plan in place already and have no live traffic. Now, with that being said, let’s move on to how we can link two jos_user tables together.

jos_users jfusion & workarounds

DANGER! SQL QUERIES AHEAD!

How to use two Joomla sites with one user table?

Birnik covered the how to pretty well in his post, so there is no sense in me re-inventing the wheel. The only thing I might add is that it is very important to go slow, take your time, turn off any distractions and think the entire thing through.

sharing jos_user tables

This looks scarier than it actually is

Keeping users logged in

Birniks solution is supposed to keep users logged in, so for example, if somebody logs into Site A, and then navigates to Site B, they should not have to re-enter their login info into Site B. I was not so lucky, and it did not work for me. That may be because I was using subdomains instead of sub directories. In the past I tried jFusion and it has a similar quirk, so I was aware of a Joomla core hack that modifies how cookies are handled and allows you to navigate between sites without getting logged out. You can read more about it here. Ignore anything about Moodle, it is not relevant to our situation.

fixing joomla subdomains and cookies

Complications?

The only problem I ran into was when new users signed up. They should all go though the main website to register. If they sign up on the slave/sub sites, you will get errors for new users. It’s an easy enough fix however, just add some redirects to send people signing up on the sub sites to the main site.

What’s your solution? Did it work for you?

Do you have any personal experience with attempting to join multiple Joomla sites together? How did it go? Let us know in the comments.

Tags: , , , ,

Merav

Merav Knafo is the founder and CEO of iJoomla, Inc. She loves writing about Joomla, usability and Social Networking.

Leave a comment

  • Avatar

    Richard

    |

    I notice your using 1.5 tables, there should not be much difference when syncing 2.5 tables? The only extension I have used was “sync”, and it was a while ago. It worked well for my application, but it wasn’t a high traffic application or that complicated.

    Reply

    • Avatar

      columbusgeek

      |

      Sure Richard, when doing 2.5->2.5 or 1.5->1.5 that’s not a problem.   Just keep in mind you cannot sync a 1.5->2.5 due to the changes in the Joomla ACL.

      Reply

      • Avatar

        braca986

        |

         @columbusgeek Can someone tell what tables are used in 2.5???

        Reply

        • Avatar

          columbusgeek

          |

           @braca986 If I recall correctly it’s the same ones.  Do you see something different?

          Reply

  • Avatar

    universita

    |

    i totally agree with columbsgeek, this can`t be done between 1.5->2.5 especially with the latest version of joomla 2.5 

    Reply

  • Avatar

    universita

    |

    with joomla 2.5 after i log in on my site i can navigate through site without   log out

    Reply

  • Avatar

    universita

    |

    i use joomla 2.5 and i have not faced this problem. I can log in once and after that i can navigate through sites 

    Reply

  • Avatar

    Kinsealyplumbing

    |

    @Matt King, Very nice article about joomla installs, I am new in joomla, So i am finding new articles about joomla.

    Reply

  • Avatar

    braca986

    |

    This thing saved my life… Thanks a lot for sharing… Just i’m stuck in sessions problem… when i check cookie “__utmz” on 2nd site it is just “1stsite.com” and by extension if i change it “2ndsite.1site.com” its working… Can someone tell me where im doing wrong???

    Reply

    • Avatar

      braca986

      |

      Ooops… My bad… Everything seems to be working in perfect order… Thanks a lot again…

      Reply

  • Avatar

    braca986

    |

    Excellent everything works like charm… Thanks a lot…

    Reply

  • Avatar

    tincan

    |

    Hi this looks like the answer to solving my problem however the links are down to the sources you have referred to in the article.

    Please please please can you explain the process by updating the article.

    Reply