Users Sharing or Synchronisation between multiple sites

This forum is for general questions about extensions for Joomla! version 1.5.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
User avatar
columbusgeek
Joomla! Apprentice
Joomla! Apprentice
Posts: 47
Joined: Mon Jun 04, 2007 1:53 pm
Location: columbus ohio
Contact:

Re: Users Sharing or Synchronisation between multiple sites

Postby columbusgeek » Thu Mar 22, 2012 6:37 pm

Fixed it.

Be sure to grant full read/write permissions to your database's and tables.

master site a - access to site b, site c and site d

slave site b - access to site a, site c and site d

slave site c - access to site a, site b and site d

slave site d - access to site a, site b, site c

When setting the permissions up in cpanel, (in my case), my logic told me all the slave sites needed access to the master site, but not to each other. this is NOT correct. All the sites databases, need full read/write permissions to each others databases.

Simple enough fix. Too bad I pulled all my hair out before I found it. :D

User avatar
kelecz
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Fri Nov 06, 2009 8:31 pm
Location: Belgrade, Serbia
Contact:

Re: Users Sharing or Synchronisation between multiple sites

Postby kelecz » Sun Mar 25, 2012 6:27 pm

Hello there,
can someone put video tutorial or pictures where to put and write something. I am tired of investigating this . Please!!!!!

THX!!!!!!!

User avatar
columbusgeek
Joomla! Apprentice
Joomla! Apprentice
Posts: 47
Joined: Mon Jun 04, 2007 1:53 pm
Location: columbus ohio
Contact:

Re: Users Sharing or Synchronisation between multiple sites

Postby columbusgeek » Sun Mar 25, 2012 7:40 pm

It's all clearly mapped out right here.

viewtopic.php?f=471&t=473666#p2015114

If that post confuses you in any way, this is not a good option for you to attempt. It is a pretty advanced technique.

D4Real
Joomla! Apprentice
Joomla! Apprentice
Posts: 43
Joined: Mon Feb 26, 2007 10:53 pm

Re: Users Sharing or Synchronisation between multiple sites

Postby D4Real » Tue Apr 24, 2012 1:15 pm

What are the tables for joomla 2.5?

braca86
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Fri May 14, 2010 11:56 am

Re: Users Sharing or Synchronisation between multiple sites

Postby braca86 » Mon May 07, 2012 2:53 pm

Yes i need this too... Can someone tell us what tables are involved for joomla 2.5??? For users and their account controll, user type and user groups... Thanks...

rpertusio
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Fri Apr 21, 2006 5:16 pm

Re: Users Sharing or Synchronisation between multiple sites

Postby rpertusio » Tue Jul 24, 2012 1:58 am

For Joomla 2.5, this is a *guess* (and appears to be working so far):

Instead of 'dropping' the table, I'm simply renaming existing ones with "_bak" so you don't lose data.

I'm syncing users (their notes, profiles), groups (their maps to users), and view levels. Not sure if that's inclusive of everything, but seems to work!


Instructions:
Find & Replace "josPrefix2" with the Joomla DB prefix you want to share TO
Find & Replace "josPrefix1" with the Joomla DB prefix you want to share FROM
Find & Replace "dbSite1" with the Joomla DB name you're sharing FROM

Code: Select all

RENAME TABLE `josPrefix2_users` TO `josPrefix2_bak_users`;
RENAME TABLE `josPrefix2_session` TO `josPrefix2_bak_session`;
RENAME TABLE `josPrefix2_usergroups` TO `josPrefix2_bak_usergroups`;
RENAME TABLE `josPrefix2_user_notes` TO `josPrefix2_bak_user_notes`;
RENAME TABLE `josPrefix2_user_profiles` TO `josPrefix2_bak_user_profiles`;
RENAME TABLE `josPrefix2_user_usergroup_map` TO `josPrefix2_bak_user_usergroup_map`;
RENAME TABLE `josPrefix2_viewlevels` TO `josPrefix2_bak_viewlevels`;

CREATE VIEW josPrefix2_users AS SELECT * FROM dbSite1.josPrefix1_users;
CREATE VIEW josPrefix2_session AS SELECT * FROM dbSite1.josPrefix1_session;
CREATE VIEW josPrefix2_usergroups AS SELECT * FROM dbSite1.josPrefix1_usergroups;
CREATE VIEW josPrefix2_user_notes AS SELECT * FROM dbSite1.josPrefix1_user_notes;
CREATE VIEW josPrefix2_user_profiles AS SELECT * FROM dbSite1.josPrefix1_user_profiles;
CREATE VIEW josPrefix2_user_usergroup_map AS SELECT * FROM dbSite1.josPrefix1_user_usergroup_map;
CREATE VIEW josPrefix2_viewlevels AS SELECT * FROM dbSite1.josPrefix1_viewlevels;


Please post if this works (or not) so I can fix up my code as well :P

- rp

seansingh
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Thu Oct 07, 2010 5:00 am

Re: Users Sharing or Synchronisation between multiple sites

Postby seansingh » Thu Nov 08, 2012 12:25 pm

Hi All,

Birnik's solution looks very well explained and just what might work for me as well.

However I have a question, I have one main site and several subdomain sites where I plan to apply this solution and create VIEWS in all my subdomains site's DBs pointing to the DB of the main site.

But after that, will new users be able to register on my subdomains as well or will i have to redirect all new users to the main site to register ? Also if they can and do register on the subdomains, will they be created in the main site's main DB ?

Hope I am clear... :)

Thanks,

Sean.

tech_php
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sun Jan 06, 2013 10:30 pm

Re: Users Sharing or Synchronisation between multiple sites

Postby tech_php » Sun Jan 13, 2013 6:59 am

Hi all,
Thanks for this topic as it give a hope to accomplish my website.
I tested this on my MAMP and everything is working perfectly. However, when I tried this on godaddy server I'm stuck in this issue:
when you create on a database it has to be on its own URL with its unique credentials (i.e. username and password).

So when I'm trying to create VIEW TABLE command on SQL it returns an error (#1142 - ANY command denied to user 'USER'@'%' for table 'jos_users' ).

I tried to use FEDERATED Tables instead, which is similar to VIEW, then the tables is created but also not able to connect to the other database server. the error message is (#1429 - Unable to connect to foreign data source: Can't connect to MySQL server on 'IP Address' (111) )

Notes:
1- as per godaddy policy, you cannot import/create two databases on the same PHPMyAdmin credentials it has to be split. each database with its own username, password, hostname and URL.
2- The syntax i'm using:
CREATE TABLE jos2_users (
id INT(11) NOT NULL AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
username VARCHAR(150) NOT NULL,
email VARCHAR(100) NOT NULL,
password VARCHAR(100) NOT NULL,
PRIMARY KEY (id)
)
ENGINE=FEDERATED
DEFAULT CHARSET=latin1
CONNECTION='mysql://USERNAME:PASSWORD@HOSTNAME OR IP/DATABASE NAME/jos_users';

And as am writing this i figure out where is the problem.... my database password contains "@" which interfering with @ located in the syntax above. Oh MY God ..... :eek:

So consider this as sharing experience .... rather than a problem :D

tbarlow
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 147
Joined: Sun Jan 13, 2008 12:41 am

Re: Users Sharing or Synchronisation between multiple sites

Postby tbarlow » Mon Mar 25, 2013 9:40 pm

So did anyone get this working in joomla 2.5 here is what I want to do

1 Domain Name
3 joomla sites using the same user database
and then 1 forum (phpbb using jFusion)

so can this be done and if so how do I do it with jooml 2.5

Thanks Guys

tbarlow

magicfix
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Thu Apr 18, 2013 8:41 am

Re: Users Sharing or Synchronisation between multiple sites

Postby magicfix » Thu Apr 18, 2013 8:44 am

But if I wanted to share articles of a single category, this method can work?

deiex
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Tue Oct 08, 2013 8:15 pm

Re: Users Sharing or Synchronisation between multiple sites

Postby deiex » Tue Oct 08, 2013 8:22 pm

rpertusio wrote:For Joomla 2.5, this is a *guess* (and appears to be working so far):

Instead of 'dropping' the table, I'm simply renaming existing ones with "_bak" so you don't lose data.

I'm syncing users (their notes, profiles), groups (their maps to users), and view levels. Not sure if that's inclusive of everything, but seems to work!


Instructions:
Find & Replace "josPrefix2" with the Joomla DB prefix you want to share TO
Find & Replace "josPrefix1" with the Joomla DB prefix you want to share FROM
Find & Replace "dbSite1" with the Joomla DB name you're sharing FROM

Code: Select all

RENAME TABLE `josPrefix2_users` TO `josPrefix2_bak_users`;
RENAME TABLE `josPrefix2_session` TO `josPrefix2_bak_session`;
RENAME TABLE `josPrefix2_usergroups` TO `josPrefix2_bak_usergroups`;
RENAME TABLE `josPrefix2_user_notes` TO `josPrefix2_bak_user_notes`;
RENAME TABLE `josPrefix2_user_profiles` TO `josPrefix2_bak_user_profiles`;
RENAME TABLE `josPrefix2_user_usergroup_map` TO `josPrefix2_bak_user_usergroup_map`;
RENAME TABLE `josPrefix2_viewlevels` TO `josPrefix2_bak_viewlevels`;

CREATE VIEW josPrefix2_users AS SELECT * FROM dbSite1.josPrefix1_users;
CREATE VIEW josPrefix2_session AS SELECT * FROM dbSite1.josPrefix1_session;
CREATE VIEW josPrefix2_usergroups AS SELECT * FROM dbSite1.josPrefix1_usergroups;
CREATE VIEW josPrefix2_user_notes AS SELECT * FROM dbSite1.josPrefix1_user_notes;
CREATE VIEW josPrefix2_user_profiles AS SELECT * FROM dbSite1.josPrefix1_user_profiles;
CREATE VIEW josPrefix2_user_usergroup_map AS SELECT * FROM dbSite1.josPrefix1_user_usergroup_map;
CREATE VIEW josPrefix2_viewlevels AS SELECT * FROM dbSite1.josPrefix1_viewlevels;


Please post if this works (or not) so I can fix up my code as well :P

- rp


Sorry to resurrect this but I need to ask something.

The solution you posted seems to work pretty well for J! 2.5.14, I iintend to use it on a number of subdomains of a master site.

I am however encountering one problem, I have setup 2 sites linked so far. if I have site A as master and site B as linked, logged in status of either is not preserved for visiting the other. I mean if you log in on A and visit B you are shown logged out, and the reverse is true too.

I have tried setting the cookie domain in both sites, clearing session data and cache data but to no avail.

Should logged in status be preserved or have I missed the point here?

Tomzie
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed Dec 04, 2013 10:21 pm

Re: Users Sharing or Synchronisation between multiple sites

Postby Tomzie » Wed Dec 04, 2013 10:32 pm

Should logged in status be preserved or have I missed the point here?


I agree,

I have just used this in Joomla 3.1.6:
Site2 is a subdomain of site1
Site1 = public
Site2 = Login required for acces

On public (site1) users can login and are redirected to memberssite (site2) But they have to login again.
:'(

Other aspects of synchronise is succesful, I can make user, notes, groups in site 1 wich apear in site 2.
Just this one critical details of login session.

Wich line have I forgotten?

Gzukry
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed Feb 12, 2014 4:59 pm

Re: Users Sharing or Synchronisation between multiple sites

Postby Gzukry » Wed Feb 12, 2014 9:03 pm

Same Problem as you: Joomla 1.5 + Mysql 5.1 + PHP5 > 1 database sharing 2 websites.

It works perfectly on a local server. Can register on both server and can Log in on server 1, it logs me on serve 2.

Online, I tried and tried again ... I can make account etc, but I have to log on both website. I'm host at OVH, sqlpro + one main domain + one subdomain.

Did someone found his way ?

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 23664
Joined: Mon Oct 27, 2008 9:27 pm
Location: Akershus, Norway

Re: Users Sharing or Synchronisation between multiple sites

Postby Per Yngve Berg » Wed Feb 12, 2014 9:29 pm

Do both sites have the same $secret in configuration.php?

ke4obt
Joomla! Apprentice
Joomla! Apprentice
Posts: 37
Joined: Thu Feb 26, 2009 5:17 pm
Location: Northeast Florida
Contact:

Re: Users Sharing or Synchronisation between multiple sites

Postby ke4obt » Wed Jun 25, 2014 9:26 pm

Thanks for the great how-to :)
I got the "create views" to work so far with Kunena and JomSocial. I'll be trying it with JDownloads.
However, right now, with my site still being developed, I have my site locked with Site Lock.http://extensions.joomla.org/extensions/miscellaneous/offline/18971
I am using Joomla 3.3, PHP 5.3 and MySQL 5.1. What do I need to do to have Site Lock linked through all of my domains - I have the one "main" and 3 sub-domains. I'm not sure which tables to edit.
I'm trying to make it so that what is enabled on one site is enabled on all and the same for whatever is disabled.
Any help is greatly appreciated.

thanks in advance,
Mickey & Flip
Last edited by imanickam on Thu Jun 26, 2014 9:46 am, edited 1 time in total.
Reason: Removed the session id from the Extension's JED URL
Flip,
The Blind wana be webmaster

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 23664
Joined: Mon Oct 27, 2008 9:27 pm
Location: Akershus, Norway

Re: Users Sharing or Synchronisation between multiple sites

Postby Per Yngve Berg » Thu Jun 26, 2014 5:23 am

This is the Joomla 1.5 forum. I will not recommend this procedure for J3.x. You will have problems with the assets table.

ChrisSoft
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Tue Feb 07, 2006 8:44 am

Re: Users Sharing or Synchronisation between multiple sites

Postby ChrisSoft » Wed Sep 20, 2017 11:43 pm

Per Yngve Berg wrote:This is the Joomla 1.5 forum. I will not recommend this procedure for J3.x. You will have problems with the assets table.


I'm sorry but i need to resume this old topic....

I have tried this procedure for joomla 3.7., everything works ok except the login.... users must log on both websites....

The 2 sites have different domains, but they have the same db...

My question is: which problems with the asset table? despite the login problem, all seems to work...

And... is there any different solution for joomla 3.x.x if i cannot use this (jfusion is no longer developed....)


Return to “Extensions for Joomla! 1.5”

Who is online

Users browsing this forum: No registered users and 10 guests