Yes, you can share the users from one Joomla! site to multiple other Joomla! sites (as long as you keep them on the same J! version). This is how you do it in Joomla! 2.5 - 3.6 (current version):
- Choose the "master" site from which the users will be shared (this is the database which will actually store the data).
- Copy the
$secret
value from the master site's configuration.php
file to the same file on all the "sister" sites.
- Ensure access to the master site's database is given to the users of each of the sister sites' databases.
Run the following SQL script on each of the sister sites' databases:
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;
Note 1: For the script above, you will need to:
- Replace
dbSite1
with the name of your master site's database.
- Replace
josPrefix1
with the prefix of your master site's database tables.
- Replace
josPrefix2
with the prefix of your sister site's database tables.
Note 2: If you already have data stored in one of the sister sites, you may need to update the user ID of many entries in the database as the user IDs will have changed. Examples: article author and modified user, LogMan access logs, etc.
References:
http://forum.joomla.org/viewtopic.php?f=470&t=473666#p2015114
http://forum.joomla.org/viewtopic.php?f=470&t=473666&p=3424061#p2850629