Answers.Body: <blockquote>
    <p>can you do it if the two sites are installed in two different locations on the same server? So not a multi-site setup?</p>
  </blockquote>
  
  <p>Yes multisite can work with different drupal codebase/databases</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-24T19:41:52.957Z
Answers.Text: So if they are at: /home/user1/public_html and /home/user2/public_html I can still share the same CiviCRM (users and all) between the two of them?
Answers.UserDisplayName: Jenni Simonis
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-25T02:54:58.133Z
Answers.Text: yes but i forget if it still requires special settings to ensure the users from Domain 1 and Domain 2 are correctly handled in uf_match table
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-25T03:12:27.983Z
Answers.Text: Ok. Hopefully someone can point me to how to do it. Everything I have found thus far is for a Drupal multi-site setup.
Answers.UserDisplayName: Jenni Simonis
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-25T05:51:03.327Z
Answers.Text: can you update your Q with the documentation you have followed/read?
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-25T11:31:07.617Z
Answers.Text: I haven't followed any yet, as they are all for a Drupal multi-site. Not sure what good it would do to post links to pages that are on a completely different solution?
Answers.UserDisplayName: Jenni Simonis
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-25T17:34:54.110Z
Answers.Text: "Everything I have found thus far is for a Drupal multi-site setup" - it would help those of us trying to help you from digging through stuff you have already looked at.
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-26T16:43:18.057Z
Answers.Text: Well, if it only focuses on Drupal multi-site, then that is what I have found thus far. I've found nothing on this topic. So if it talks about how to do this with Drupal in different installs, then I haven't seen it.
Answers.UserDisplayName: Jenni Simonis
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-26T21:16:08.670Z
Answers.Text: This is the main one. The others have just been questions about Drupal multi-sites on here: https://docs.civicrm.org/sysadmin/en/latest/install/multi-site/
Answers.UserDisplayName: Jenni Simonis
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-29T21:55:26.070Z
Answers.Text: WHen I look at  https://docs.civicrm.org/sysadmin/en/latest/install/multi-site/ it only starts talking about Drupal Domain near the end. Otherwise the instructions should work whether your Drupal sites are using the same drupal codebase or not
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-24T19:02:50.683Z
Answers.LastActivityDate: 2018-10-24T19:02:50.683Z
Answers.UserDisplayName: petednz - fuzion
Answers.Body: <p>Answering your new question. You say:</p>
  
  <blockquote>
    <p>"For example if your new contact is 555" - what new contact? I can add the line, but have no idea what the "contact_id" field should contain.</p>
  </blockquote>
  
  <p>In the documentation, in the line above that query it says</p>
  
  <blockquote>
    <p>Create a new contact to be the domain contact for the new domain</p>
  </blockquote>
  
  <p>In other words, every 'domain' needs to have an Organisational contact record that it is associated with.</p>
  
  <p>Does that help?</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-01T02:33:29.290Z
Answers.Text: Yes, that was the missing piece - that the "new contact" means create an organizational record. Of course the only issue is that both sites are the same organization. So would I just link it to the same organization, or does it have to be unique?
Answers.UserDisplayName: Jenni Simonis
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-01T03:50:44.817Z
Answers.Text: pretty sure it has to be unique as it is what 'relates' to the domain
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-01T05:06:48.387Z
Answers.Text: Hmmm... Hope that doesn't cause any issues, then, since they're both the same organization. I guess I will just create another one that just has almost the exact same name and use that. Right now it just has the contact id for the same one.
Answers.UserDisplayName: Jenni Simonis
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-31T19:42:24.187Z
Answers.LastActivityDate: 2018-10-31T19:42:24.187Z
Answers.UserDisplayName: petednz - fuzion
Answers.Body: <p>To answer the followup question - two separate CMSes on the same server can share the same CiviCRM EXCEPT for the users.  Since users are controlled by the CMS, the users are tied to the CMS.</p>
  
  <p>If you want to share users, you'll need to use a solution that shares users at the CMS level, like OAuth, LDAP, SAML or Bakery.  Or you could just make the same users on both servers.  The only catch is that each user will have two CiviCRM records, one per account.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-25T11:30:02.133Z
Answers.Text: Yes, the user log-ins would be through Bakery. I mean their details that are stored inside CiviCRM as opposed to Drupal. I need them to be able to access their membership information, event purchase information, etc.
Answers.UserDisplayName: Jenni Simonis
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-25T17:44:29.810Z
Answers.Text: Hmm - I'm not 100% sure you can do this tbh.  Reason being, the CiviCRM contact is tied to the user, which is site-aware.  So John Doe will have two Civi records - one connected to site A, one connected to site B.  It's not possible to connect a single Civi contact to two separate users.
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-26T16:42:28.540Z
Answers.Text: It's not two separate users - you use a module like Bakery, which shares the same users between two accounts. This is already done all the time with a Drupal multi-site where they're sharing the same Drupal codebase inside the same account on the server.
Answers.UserDisplayName: Jenni Simonis
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-26T19:07:46.720Z
Answers.Text: You're free to try it and see if it works  - please let us know if it does!  However, my understanding is that Bakery syncs records between the `users` table on multiple Drupal sites.  While functionally that appears as "one user account", each database maintains its own `users` record - which is what CiviCRM relies on.  Hopefully I'm wrong though!
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-26T21:16:58.843Z
Answers.Text: Well, it must work since there are official pages on how to have a Drupal multi-site run on one CiviCRM database.
Answers.UserDisplayName: Jenni Simonis
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-26T22:05:08.710Z
Answers.Text: I'm not doubting that multi-site will work.  I'm concerned that CiviCRM will see the two user accounts (John Doe on site 1, John Doe on site 2) as two separate users, because Bakery will create an entry in each site's Drupal `users` table. Which means that the contact dashboard for John Doe 1 and John Doe 2 will be different - the memberships will only be attached to one of them.
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-29T04:32:48.700Z
Answers.Text: Jenni, I have been looking at this problem for a similar case but haven't found a solution so far. The problem I see with Bakery is that [it does not sync the UID of the user accounts](https://www.drupal.org/node/1278432). That means that the civicrm_uf_match DB table cannot map CiviCRM contacts to the Drupal users of both Drupal installations.
  That wouldn't be the case if you shared user tables between the two Drupal databases but the [latest advice seems to be against shared tables](https://drupal.stackexchange.com/a/226215).
Answers.UserDisplayName: Andrew Thompson
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-29T05:43:55.477Z
Answers.Text: Yes, it's supposed to be a security risk now to share the user tables. That's how I used to do these things. Bakery was what folks recommended and is apparently what they use for Drupal Groups. I'm happy to use some other method of syncing the users. I just need them to be the same across both and have access to membership and such across both since they get discounts on site1 and access on site2.
Answers.UserDisplayName: Jenni Simonis
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-25T04:12:35.070Z
Answers.LastActivityDate: 2018-10-25T04:12:35.070Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>Ok, so I gave up on having it in two different locations since I couldn't seem to get a clear answer from anyone regarding it being able to be done. So I've moved everything over and set it up as a Drupal multi-site. Now I am working to connect CiviCRM to the second site. It's already been on the main site for years.</p>
  
  <p>However, the instructions on how to do the CiviCRM multi-site seem to be missing some steps or making some assumptions. As such, I'm stuck. I'm using the instructions here: <a href="https://docs.civicrm.org/sysadmin/en/latest/install/multi-site/" rel="nofollow noreferrer">https://docs.civicrm.org/sysadmin/en/latest/install/multi-site/</a></p>
  
  <p>The page says:</p>
  
  <pre><code>Create the domain record¶
  Insert a new domain record into the CiviCRM database. For example if your new contact is 555
  
  INSERT INTO `civicrm_domain` (
    `name`,
    `description`,
    `version`,
    contact_id)
  SELECT 
    'site 2',
    'second test site',
    cd.version,
    555
  FROM civicrm_domain cd
  WHERE cd.id = 1;
  </code></pre>
  
  <p>"For example if your new contact is 555" - what new contact? I can add the line, but have no idea what the "contact_id" field should contain.</p>
  
  <p>As such, I'm stuck at this step.</p>
  
  <hr>
  
  <p>OLD QUESTION:</p>
  
  <p>I know you can have multiple sites using the same CiviCRM install. Usually they are set up using a Drupal multi-site. But can you do it if the two sites are installed in two different locations on the same server? So not a multi-site setup?</p>
  
  <p>I'd love to keep the two sites separate, as then the backups of them are smaller, easier to restore when necessary, etc. Not to mention that I don't bother the live site trying to merge the two (one is a renovation on an older site). If I have to have them in the same directory, I can do that, but would rather not. So I thought I would check.</p>
  
  <p>I want the two sites to be able to have a user be attached to their membership record, for instance, because that controls their access to various items. Or be able to see the trainings they've gone to. Be able to update their record. </p>
  
  <p>So I need to know:</p>
  
  <ol>
  <li><p>Can I have two sites in different directories that use the same CiviCRM install <em>and</em> database so that the data is shared? So that the same user can see their same information in Civi regardless of which site they are on?</p></li>
  <li><p>If not, if they are set up as a Drupal multi-site in the same directory, would it work? Would they share the same CiviCRM install <em>and</em> database so that the data is shared? So that the same user can see their same information in Civi regardless of which site they are on?</p></li>
  </ol>
  
  <p>I need to know pretty quickly, because I'm to the merging stage of these two sites and I need to know if I am going to have to completely redo the strategy and do the fake multi-site thing in Drupal where they look to be separate sites, but aren't. I'd rather not do that, though, as it will make our SQL database <em>huge</em> since it's an informational site with tens of thousands of records.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-10-29T04:35:55.690Z
Comments.Text: When you refer to "the fake multi-site thing" are you referring to the Domain Access module?
Comments.UserDisplayName: Andrew Thompson
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-10-29T05:42:01.663Z
Comments.Text: Yes, I think that is the module that I was thinking of. I'd rather not do it since it would make our database absolutely enormous. Not to mention having to do a *lot* of new configuration on the main site, plus rebuild everything from the dev second site onto the live site. I'd really like to keep these two in separate Drupal databases.
Comments.UserDisplayName: Jenni Simonis
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-10-29T21:52:26.177Z
Comments.Text: Jenni - i would love to better understand what you are finding is preventing you from setting up two drupal codebases with a single civicrm. The 'domain' value in the uf_match ensures that the drupal users are correctly associated with the right civicrm record.
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-10-30T02:37:05.943Z
Comments.Text: The question is about doing it from two different hosting accounts: So one is at /home/user1/public_html/ and the other is at /home/user2/public_html/
Comments.UserDisplayName: Jenni Simonis
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-10-30T02:38:39.750Z
Comments.Text: I'd prefer to do it in two different hosting accounts so that I'm not needing to be in messing with the live site other than some minor changes to connect the two sites to CiviCRM. If I need to do it in one hosting account, I will, but would prefer to do it in two. If I do it in one, then it will work for the two different Drupal installs that are utilizing Bakery (shares the users across the 2 sites) to connect those users to the correct CiviCRM record, correct?
Comments.UserDisplayName: Jenni Simonis
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-10-31T07:52:38.420Z
Comments.Text: Ok, I've updated the question above and just made it a multi-site. But I'm still running into issues.
Comments.UserDisplayName: Jenni Simonis
Tags: <drupal><multisite>
Title: CiviCRM on multiple sites
ThreadText: # CiviCRM on multiple sites
  
  (Asked by: username_0 on 2018-10-24)
  
  Ok, so I gave up on having it in two different locations since I couldn't seem to get a clear answer from anyone regarding it being able to be done. So I've moved everything over and set it up as a Drupal multi-site. Now I am working to connect CiviCRM to the second site. It's already been on the main site for years.
  However, the instructions on how to do the CiviCRM multi-site seem to be missing some steps or making some assumptions. As such, I'm stuck. I'm using the instructions here: https://docs.civicrm.org/sysadmin/en/latest/install/multi-site/
  The page says:
  Create the domain record¶
  Insert a new domain record into the CiviCRM database. For example if your new contact is 555
  
  INSERT INTO `civicrm_domain` (
    `name`,
    `description`,
    `version`,
    contact_id)
  SELECT 
    'site 2',
    'second test site',
    cd.version,
    555
  FROM civicrm_domain cd
  WHERE cd.id = 1;
  
  "For example if your new contact is 555" - what new contact? I can add the line, but have no idea what the "contact_id" field should contain.
  As such, I'm stuck at this step.
  
  OLD QUESTION:
  I know you can have multiple sites using the same CiviCRM install. Usually they are set up using a Drupal multi-site. But can you do it if the two sites are installed in two different locations on the same server? So not a multi-site setup?
  I'd love to keep the two sites separate, as then the backups of them are smaller, easier to restore when necessary, etc. Not to mention that I don't bother the live site trying to merge the two (one is a renovation on an older site). If I have to have them in the same directory, I can do that, but would rather not. So I thought I would check.
  I want the two sites to be able to have a user be attached to their membership record, for instance, because that controls their access to various items. Or be able to see the trainings they've gone to. Be able to update their record. 
  So I need to know:
  
  Can I have two sites in different directories that use the same CiviCRM install and database so that the data is shared? So that the same user can see their same information in Civi regardless of which site they are on?
  If not, if they are set up as a Drupal multi-site in the same directory, would it work? Would they share the same CiviCRM install and database so that the data is shared? So that the same user can see their same information in Civi regardless of which site they are on?
  
  I need to know pretty quickly, because I'm to the merging stage of these two sites and I need to know if I am going to have to completely redo the strategy and do the fake multi-site thing in Drupal where they look to be separate sites, but aren't. I'd rather not do that, though, as it will make our SQL database huge since it's an informational site with tens of thousands of records.
  
  **Tags:** drupal, multisite
  
  > **Comments:**
  > **username_1**: When you refer to "the fake multi-site thing" are you referring to the Domain Access module?  
  > **username_0**: Yes, I think that is the module that I was thinking of. I'd rather not do it since it would make our database absolutely enormous. Not to mention having to do a *lot* of new configuration on the main site, plus rebuild everything from the dev second site onto the live site. I'd really like to keep these two in separate Drupal databases.  
  > **username_2**: Jenni - i would love to better understand what you are finding is preventing you from setting up two drupal codebases with a single civicrm. The 'domain' value in the uf_match ensures that the drupal users are correctly associated with the right civicrm record.  
  > **username_0**: The question is about doing it from two different hosting accounts: So one is at /home/user1/public_html/ and the other is at /home/user2/public_html/  
  > **username_0**: I'd prefer to do it in two different hosting accounts so that I'm not needing to be in messing with the live site other than some minor changes to connect the two sites to CiviCRM. If I need to do it in one hosting account, I will, but would prefer to do it in two. If I do it in one, then it will work for the two different Drupal installs that are utilizing Bakery (shares the users across the 2 sites) to connect those users to the correct CiviCRM record, correct?  
  > **username_0**: Ok, I've updated the question above and just made it a multi-site. But I'm still running into issues.  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_2 on 2018-10-24. Score: 1
  
  > can you do it if the two sites are installed in two different locations on the same server? So not a multi-site setup?
  
  Yes multisite can work with different drupal codebase/databases
  
  > **Comments:**
  > **username_0**: So if they are at: /home/user1/public_html and /home/user2/public_html I can still share the same CiviCRM (users and all) between the two of them?  
  > **username_2**: yes but i forget if it still requires special settings to ensure the users from Domain 1 and Domain 2 are correctly handled in uf_match table  
  > **username_0**: Ok. Hopefully someone can point me to how to do it. Everything I have found thus far is for a Drupal multi-site setup.  
  > **username_2**: can you update your Q with the documentation you have followed/read?  
  > **username_0**: I haven't followed any yet, as they are all for a Drupal multi-site. Not sure what good it would do to post links to pages that are on a completely different solution?  
  > **username_2**: "Everything I have found thus far is for a Drupal multi-site setup" - it would help those of us trying to help you from digging through stuff you have already looked at.  
  > **username_0**: Well, if it only focuses on Drupal multi-site, then that is what I have found thus far. I've found nothing on this topic. So if it talks about how to do this with Drupal in different installs, then I haven't seen it.  
  > **username_0**: This is the main one. The others have just been questions about Drupal multi-sites on here: https://docs.civicrm.org/sysadmin/en/latest/install/multi-site/  
  > **username_2**: WHen I look at  https://docs.civicrm.org/sysadmin/en/latest/install/multi-site/ it only starts talking about Drupal Domain near the end. Otherwise the instructions should work whether your Drupal sites are using the same drupal codebase or not  
  
  ---
  
  ### Answer by username_2 on 2018-10-31. Score: 0
  
  Answering your new question. You say:
  
  > "For example if your new contact is 555" - what new contact? I can add the line, but have no idea what the "contact\_id" field should contain.
  
  In the documentation, in the line above that query it says
  
  > Create a new contact to be the domain contact for the new domain
  
  In other words, every 'domain' needs to have an Organisational contact record that it is associated with.
  
  Does that help?
  
  > **Comments:**
  > **username_0**: Yes, that was the missing piece - that the "new contact" means create an organizational record. Of course the only issue is that both sites are the same organization. So would I just link it to the same organization, or does it have to be unique?  
  > **username_2**: pretty sure it has to be unique as it is what 'relates' to the domain  
  > **username_0**: Hmmm... Hope that doesn't cause any issues, then, since they're both the same organization. I guess I will just create another one that just has almost the exact same name and use that. Right now it just has the contact id for the same one.  
  
  ---
  
  ### Answer by username_3 on 2018-10-25. Score: 0
  
  To answer the followup question - two separate CMSes on the same server can share the same CiviCRM EXCEPT for the users. Since users are controlled by the CMS, the users are tied to the CMS.
  
  If you want to share users, you'll need to use a solution that shares users at the CMS level, like OAuth, LDAP, SAML or Bakery. Or you could just make the same users on both servers. The only catch is that each user will have two CiviCRM records, one per account.
  
  > **Comments:**
  > **username_0**: Yes, the user log-ins would be through Bakery. I mean their details that are stored inside CiviCRM as opposed to Drupal. I need them to be able to access their membership information, event purchase information, etc.  
  > **username_3**: Hmm - I'm not 100% sure you can do this tbh.  Reason being, the CiviCRM contact is tied to the user, which is site-aware.  So John Doe will have two Civi records - one connected to site A, one connected to site B.  It's not possible to connect a single Civi contact to two separate users.  
  > **username_0**: It's not two separate users - you use a module like Bakery, which shares the same users between two accounts. This is already done all the time with a Drupal multi-site where they're sharing the same Drupal codebase inside the same account on the server.  
  > **username_3**: You're free to try it and see if it works  - please let us know if it does!  However, my understanding is that Bakery syncs records between the `users` table on multiple Drupal sites.  While functionally that appears as "one user account", each database maintains its own `users` record - which is what CiviCRM relies on.  Hopefully I'm wrong though!  
  > **username_0**: Well, it must work since there are official pages on how to have a Drupal multi-site run on one CiviCRM database.  
  > **username_3**: I'm not doubting that multi-site will work.  I'm concerned that CiviCRM will see the two user accounts (John Doe on site 1, John Doe on site 2) as two separate users, because Bakery will create an entry in each site's Drupal `users` table. Which means that the contact dashboard for John Doe 1 and John Doe 2 will be different - the memberships will only be attached to one of them.  
  > **username_1**: Jenni, I have been looking at this problem for a similar case but haven't found a solution so far. The problem I see with Bakery is that [it does not sync the UID of the user accounts](https://www.drupal.org/node/1278432). That means that the civicrm_uf_match DB table cannot map CiviCRM contacts to the Drupal users of both Drupal installations. That wouldn't be the case if you shared user tables between the two Drupal databases but the [latest advice seems to be against shared tables](https://drupal.stackexchange.com/a/226215).  
  > **username_0**: Yes, it's supposed to be a security risk now to share the user tables. That's how I used to do these things. Bakery was what folks recommended and is apparently what they use for Drupal Groups. I'm happy to use some other method of syncing the users. I just need them to be the same across both and have access to membership and such across both since they get discounts on site1 and access on site2.  
  
  ---
  
  