I'm making my way through the huge mass of multisite posts but haven't found one that truly matches my needs yet. I would really appreciate some advice on how to approach my situation.
For now, I have 2 completely separate sites, separate databases. The only real link I need between them is the user login/profile information. I'd like for all of the user data from site1 to be used for site2. Is there a way to set up site2 so that it looks to site1's database for the users? They are on the same hosting server, but under different accounts. Also, how does that work if a user registers on site2? (sorry, I'm trying to learn all this at a trial-by-bonfire rate) If I'm thinking correctly, a new user on site2's registration would be added to the user tables on site1?
That's the easy question.... Now looking to future plans:
If the business plan succeeds, site1 will need some major scalability. Basically, I will eventually have a site for different cities. I can't share the entire database; it would be far too large, each city site needs its own database. But is there a way to share user data across every city site? I would need to share not just login information, but also for modules like userpoints. So if a person earns points on the Atlanta site, they can go to the Chicago site and still have their point balance, etc.
Would it be best to use the same source files (I think I'm using the right term here) and have the city sites set up as subdomains with individual databases? And is this possible if I need to break up my hosting (referring to databases on another server possibly)?
Hopefully, that's all clearer than mud.
Comments
This isn't a multisite issue
instead it is a table sharing issue. Sure multisite setups can share database tables, but they don't need to and non multisite setups can also share DB tables. It is a completely separate thing to multisite. Multisite is where one Drupal installation can respond to different urls differently by giving each set of urls its own settings.php file and its own themes/modules etc.
In the settings.php file you can do things like redirect certain tables to a different database, and/or add site specific prefixes to all or some table names etc.
There is a single sign on module (I haven't used it) that helps with this and I think its documentation tells you which tables need to be shared etc.
But keep in mind that sharing db tables can make upgrades difficult as you will have to upgrade each site at the same time, and the shared tables will try to get upgraded each time. Also between upgrading each site the shared tables schema won't match the not yet upgraded sites. Apparently there is some work going on to address this in a future version though.
--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ
Thoughts...
You can have per-table prefixes in the settings.php file by making it an array. (See the example in the comment.)
I haven't tested this, but you should be able to have a seperate *database* dedicated to the login (as opposed to tables in the *current* db, which is the normal way of doing things) by setting your prefixes on the shared tables to be the name of said database followed by a period.
This should allow you to split things into seperate databases.
Something like this:
will probabaly work.
You can have seperate source trees if you wish. A seperate database server (lots of ram, fast disks) is a good idea for larger sites.
Thanks to you both!
Styro, thanks for clarifying. I was still trying to wrap my mind around the whole multisite concept, but your explanation summed it up well. I'll just have to suffer through the upgrades - I don't think there's any way I can avoid that unless they do add something in future versions to help. I'll take a closer look at the single sign-on module. I did skim over it, but wasn't sure it would work for me.
Bdragon, thanks for the idea. That might be something to consider down the road - making all of the user information a single database that is accessed by each site. Did I understand that correctly? For now, I think I can get by with the suggestion of redirecting site2 to site1's database for login info.
Appreciate it!