Acount Sync Multisites

mrbrns's picture

Hi, I've two sites in a multisite install from the subdomain type, they've been running for a while each one of them has it's own database and they only share the codebase. But now I need to integrate both sites with a single sign on, I've tried with bakery but the problem is that in both sites I have pre existing users so I need something to sync the accounts, I found this module Account Sync but it gives me a mysql syntax error:
"SELECT DISTINCT ur.uid FROM {role} r LEFT JOIN {users_roles} ur ON r.rid = ur.rid WHERE ur.uid IS NOT NULL AND IN () ORDER BY ur.uid "

Since I'm not a programer, even I understand the basics I would appreciate any help or any pointer about how to fix this or any ideas to solve the syncong accounts problem.



Acount Sync Multisites

manuel_mra's picture

It seems that as each site there has been duplication being created independently identifiers users and roles.
Perhaps one solution is to create sites without users and use again that synchronize module to recreate users.
Another solution would be to start or join delete users manually but I think the first solution suggested is right.

Yes indeed

mrbrns's picture

I tried the first solution but there seems to be a problem with the query in the Account Sync module

Re: Acount Sync Multisites

tsssystems's picture

Personally, I wouldn't use a module, I'd just go ahead and share the users and roles between the two sites. You can accomplish this by creating a new database, specifying it as a common database shared by both sites, and including all the tables affecting users and roles in it. Those same tables would be removed from the separate databases that the sites use.

Take a look at these discussions:


Do you have users that are the same for both sites now? If you do, it might be easier to use the table with the largest number of users as a base and then add the unique users from the other site's table.

Once it's set up correctly, adding a user once will allow that person to log in to both sites; in fact, once they're logged in, they won't need to log in when visiting the 2nd site.

Thanks, I'll check this out

mrbrns's picture

Thanks, I'll check this out and see if I can figure out how to do it

The big problem here is that

mrbrns's picture

The big problem here is that I've related content to users in both sites, I'm thinking that maybe I can change the users uid in one of the sites to make it work with bakery, am I saying nonsense here? I guess if i do this I would also have to change all the id's to the content related to this user or something like that.

It all depends upon the number...

tsssystems's picture

of users and nodes you have, and whether you have the same user registered on both sites, especially if that user has posted content. I don't use Bakery myself but obviously was able to get around this problem. One article to look at might be:

Synching Bakery accounts between the master and slave sites

Posted by greggles on April 2, 2012 at 4:48pm

If you merge a slave site into a bakery cluster where there are some overlapping users you are likely to have some problems. This page describes how to fix some of those problems. Conflicting slave site accounts This scenario has three users that all belong to the same person: user #123 on master ...

How about removing the site folder

AdamKahn's picture

Just remove the sites folder, then drop the database.

Or remove them entirely, or move them to single site installs?

If it's the former, then surely it's just a matter of removing the sites/ folders along with their databases, then removing the lines from sites.php? Am I missing something?